From d993fb09b7f44d9f47ba8d0f2cb2865f4cd0912b Mon Sep 17 00:00:00 2001 From: zosrothko Date: Sun, 18 Feb 2018 17:29:48 +0100 Subject: [PATCH] Poco 1.9.0: Additional fixes for PDF and Encodings (#2169) * Update gradle for the Encodings module Signed-off-by: Francis ANDRE * Add new PDF c++ files to VS projects * Update gradle build --- Encodings/build.gradle | 46 ++++ Encodings/samples/build.gradle | 30 +++ Encodings/testsuite/build.gradle | 81 +++++++ PDF/PDF_vs140.vcxproj | 354 ++++++++++++++++--------------- PDF/PDF_vs140.vcxproj.filters | 8 +- PDF/PDF_vs90.vcproj | 8 + PDF/build.gradle | 1 + settings.gradle | 29 +-- 8 files changed, 368 insertions(+), 189 deletions(-) create mode 100644 Encodings/build.gradle create mode 100644 Encodings/samples/build.gradle create mode 100644 Encodings/testsuite/build.gradle diff --git a/Encodings/build.gradle b/Encodings/build.gradle new file mode 100644 index 000000000..75c151520 --- /dev/null +++ b/Encodings/build.gradle @@ -0,0 +1,46 @@ +model { + components { + Encodings(NativeLibrarySpec) { + sources { + rc { + source { + srcDir '..' + include 'DLLVersion.rc' + } + } + c { + source { + srcDir 'src' + include '**/*.c' + } + exportedHeaders { + srcDir 'include' + } + lib project: ':Foundation', library: 'Foundation' + } + cpp { + source { + srcDir 'src' + include '**/*.cpp' + } + exportedHeaders { + srcDir 'include' + } + lib project: ':Foundation', library: 'Foundation' + } + } + } + } + binaries { + withType(SharedLibraryBinarySpec) { + if (toolChain in VisualCpp) { + cCompiler.define "Encodings_EXPORTS" + cppCompiler.define "Encodings_EXPORTS" + } + } + withType(StaticLibraryBinarySpec) { + } + } +} +task poco { dependsOn "assemble" } + diff --git a/Encodings/samples/build.gradle b/Encodings/samples/build.gradle new file mode 100644 index 000000000..4c1ddcd37 --- /dev/null +++ b/Encodings/samples/build.gradle @@ -0,0 +1,30 @@ +model { + components { + TextConverter(NativeExecutableSpec) { + sources { + cpp.source { srcDir 'TextConverter/src' include '**/*.cpp' } + cpp.lib project: ':Encodings', library: 'Encodings' + cpp.lib project: ':Foundation', library: 'Foundation' + } + } + } + binaries { + all { + } + withType(SharedLibraryBinarySpec) { + lib project: ':Encodings', library: 'Encodings', linkage: 'shared' + lib project: ':Foundation', library: 'Foundation', linkage: 'shared' + } + withType(StaticLibraryBinarySpec) { + lib project: ':Encodings', library: 'Encodings', linkage: 'static' + lib project: ':Foundation', library: 'Foundation', linkage: 'static' + } + withType(NativeExecutableSpec) { + lib project: ':Encodings', library: 'Encodings', linkage: 'static' + lib project: ':Foundation', library: 'Foundation', linkage: 'static' + } + } +} +task samples { dependsOn "assemble" } + + diff --git a/Encodings/testsuite/build.gradle b/Encodings/testsuite/build.gradle new file mode 100644 index 000000000..ea9579f3f --- /dev/null +++ b/Encodings/testsuite/build.gradle @@ -0,0 +1,81 @@ +import org.gradle.nativeplatform.test.cppunit.CppUnitTestSuiteSpec + +model { + components { + withType(NativeComponentSpec) { + binaries.withType(NativeBinarySpec) { + if (buildType == buildTypes.debug) { + if (it instanceof NativeExecutableBinarySpec) { + executable.file = toLocalBin(appendDebugSuffix(executable.file), targetPlatform) + } + } else + if (buildType == buildTypes.release) { + if (it instanceof NativeExecutableBinarySpec) { + executable.file = toLocalBin(executable.file, targetPlatform) + } + } + } + } + TestSuite(NativeLibrarySpec) { m -> + sources { + cpp { + source { + srcDir 'src' + include '**/*.cpp' + exclude 'Win*.cpp' + exclude 'Driver.cpp' + } + exportedHeaders { + srcDir 'src' + } + lib project: ':CppUnit', library: 'CppUnit', linkage: 'shared' + lib project: ':Encodings', library: 'Encodings', linkage: 'shared' + lib project: ':Foundation', library: 'Foundation', linkage: 'shared' + } + } + binaries.all { + if (targetPlatform.operatingSystem.windows) { + sources { + platformWindows(CppSourceSet) { + lib m.sources.cpp + source { + srcDir 'src' + include 'Win*.cpp' + exclude '*Driver.cpp' + } + exportedHeaders { + srcDir 'src' + } + } + } + } + } + } + } + testSuites { + UtilTestSuite(org.gradle.nativeplatform.test.cppunit.CppUnitTestSuiteSpec) { + testing $.components.TestSuite + } + } + binaries { + withType(org.gradle.nativeplatform.test.cppunit.CppUnitTestSuiteBinarySpec) { + lib project: ':CppUnit', library: 'CppUnit', linkage: 'shared' + if (toolChain in VisualCpp) { + if (buildType == buildTypes.debug) { + cCompiler.args "/MDd" + cppCompiler.args "/MDd" + } else + if (buildType == buildTypes.release) { + cCompiler.args "/MD" + cppCompiler.args "/MD" + } else { + throw new GradleException("Unknown buildType" + buildType) + } + } + if (toolChain in Gcc) { + } + } + } +} +task testsuite { dependsOn "assemble" } + diff --git a/PDF/PDF_vs140.vcxproj b/PDF/PDF_vs140.vcxproj index d8b8e7e8e..6fd998691 100644 --- a/PDF/PDF_vs140.vcxproj +++ b/PDF/PDF_vs140.vcxproj @@ -1,4 +1,4 @@ - + @@ -32,7 +32,7 @@ PDF Win32Proj - + StaticLibrary MultiByte @@ -63,27 +63,27 @@ MultiByte v140 - - + + - + - + - + - + - + - + - + <_ProjectFileVersion>14.0.25123.0 PocoPDFd @@ -132,7 +132,7 @@ true true true - + Level3 ProgramDatabase Default @@ -163,9 +163,9 @@ true true true - + Level3 - + Default @@ -193,7 +193,7 @@ true true true - + ..\lib\PocoPDFmtd.pdb Level3 ProgramDatabase @@ -218,9 +218,9 @@ true true true - + Level3 - + Default @@ -240,7 +240,7 @@ true true true - + ..\lib\PocoPDFmdd.pdb Level3 ProgramDatabase @@ -265,10 +265,10 @@ true true true - + ..\lib\PocoPDFmd.pdb Level3 - + Default @@ -276,161 +276,165 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + \ No newline at end of file diff --git a/PDF/PDF_vs140.vcxproj.filters b/PDF/PDF_vs140.vcxproj.filters index 09c7aad41..4ca87af76 100644 --- a/PDF/PDF_vs140.vcxproj.filters +++ b/PDF/PDF_vs140.vcxproj.filters @@ -1,4 +1,4 @@ - + @@ -327,6 +327,12 @@ 3rd Party\HARU\Source Files + + Source Files + + + + diff --git a/PDF/PDF_vs90.vcproj b/PDF/PDF_vs90.vcproj index ca7f89c61..a0657c64b 100644 --- a/PDF/PDF_vs90.vcproj +++ b/PDF/PDF_vs90.vcproj @@ -390,6 +390,10 @@ + + + + diff --git a/PDF/build.gradle b/PDF/build.gradle index 3fecdb3b5..6cad7adb9 100644 --- a/PDF/build.gradle +++ b/PDF/build.gradle @@ -21,6 +21,7 @@ project(":PDF") { srcDirs 'include', 'include/Poco/PDF' } lib project: ':Util', library: 'Util' + lib project: ':XML', library: 'XML' lib project: ':Foundation', library: 'Foundation' } } diff --git a/settings.gradle b/settings.gradle index d483ac258..959fd2925 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,6 +2,7 @@ def os = org.gradle.internal.os.OperatingSystem.current() rootProject.name = 'Poco' include ':CppUnit' +include ':Encodings' include ':Foundation' include ':XML' include ':JSON' @@ -12,12 +13,12 @@ include ':NetSSL_OpenSSL' if (os.windows) { include ':NetSSL_Win' } -include ':Data' +include ':SQL' if (os.windows) { - include ':Data:ODBC' - include ':Data:SQLite' - include ':Data:MySQL' - include ':Data:PostgreSQL' + include ':SQL:ODBC' + include ':SQL:SQLite' + include ':SQL:MySQL' + include ':SQL:PostgreSQL' } include ':Zip' include ':PageCompiler' @@ -29,38 +30,40 @@ include ':Redis' include ':PocoDoc' include ':ProGen' +include ':Encodings:testsuite' include ':Foundation:testsuite' include ':XML:testsuite' include ':JSON:testsuite' include ':Util:testsuite' include ':Net:testsuite' -include ':Crypto:testsuite' +//include ':Crypto:testsuite' include ':NetSSL_OpenSSL:testsuite' if (os.windows) { include ':NetSSL_Win:testsuite' } -include ':Data:testsuite' +include ':SQL:testsuite' if (os.windows) { - include ':Data:ODBC:testsuite' - include ':Data:SQLite:testsuite' - include ':Data:MySQL:testsuite' - include ':Data:PostgreSQL:testsuite' + include ':SQL:ODBC:testsuite' + include ':SQL:SQLite:testsuite' + include ':SQL:MySQL:testsuite' + include ':SQL:PostgreSQL:testsuite' } //include ':MongoDB:testsuite' include ':Redis:testsuite' include ':CppParser:testsuite' include ':Zip:testsuite' +include ':Encodings:samples' include ':Foundation:samples' if (os.windows) { - include ':Data:samples' + include ':SQL:samples' } include ':NetSSL_OpenSSL:samples' if (os.windows) { include ':NetSSL_Win:samples' } include ':JSON:samples' -include ':MongoDB:samples' +//include ':MongoDB:samples' include ':Net:samples' include ':PageCompiler:samples' include ':PDF:samples'