mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-11-02 19:48:00 +00:00
Backport of pocoproject/feature-gradle to pocoproject/develop (#2127)
* Backport of feature-gradle Signed-off-by: Francis ANDRE <francis.andre.kampbell@orange.fr> * Replace '/' by '\' to comply with DOS path Signed-off-by: Francis ANDRE <francis.andre.kampbell@orange.fr> * Cleanup Signed-off-by: Francis ANDRE <francis.andre.kampbell@orange.fr> * Put environment setting at the Exec task. Signed-off-by: Francis ANDRE <francis.andre.kampbell@orange.fr> * Use standard release Signed-off-by: Francis ANDRE <francis.andre.kampbell@orange.fr> * Updated mkdoc configuration Signed-off-by: Francis ANDRE <francis.andre.kampbell@orange.fr> * Remove lines guarded by POCO_ENABLE_CPP11 Signed-off-by: Francis ANDRE <francis.andre.kampbell@orange.fr> * Merge remote-tracking branch 'origin/develop' into develop * Fix NuGet & Wix input dependencies file set. Signed-off-by: Francis ANDRE <francis.andre.kampbell@orange.fr> * Remaining fixes for Data2SQL switch. * Use $global:LastExitCode instead of a local LastExitCode
This commit is contained in:
committed by
Aleksandar Fabijanic
parent
22ddce7c9d
commit
5fa3d6094e
104
SQL/MySQL/build.gradle
Normal file
104
SQL/MySQL/build.gradle
Normal file
@@ -0,0 +1,104 @@
|
||||
model {
|
||||
repositories {
|
||||
libs(PrebuiltLibraries) {
|
||||
mysql {
|
||||
headers.srcDir "$mysql32Home/include"
|
||||
binaries.withType(StaticLibraryBinary) {
|
||||
def libName = "foobar"
|
||||
if (buildType == buildTypes.debug) {
|
||||
libName = 'libmysqld.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
staticLibraryFile = file("$mysql32Home/lib/$libName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$mysql64Home/include"
|
||||
staticLibraryFile = file("$mysql64Home/lib/$libName")
|
||||
}
|
||||
} else
|
||||
if (buildType == buildTypes.release) {
|
||||
libName = 'libmysql.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$mysql32Home/include"
|
||||
staticLibraryFile = file("$mysql32Home/lib/$libName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$mysql64Home/include"
|
||||
staticLibraryFile = file("$mysql64Home/lib/$libName")
|
||||
}
|
||||
} else {
|
||||
throw new GradleException("Unknown buildType" + buildType)
|
||||
}
|
||||
}
|
||||
binaries.withType(SharedLibraryBinary) {
|
||||
def dllName
|
||||
def linkName
|
||||
if (buildType == buildTypes.debug) {
|
||||
dllName = 'libmysqld.dll'
|
||||
linkName = 'libmysqld.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$mysql32Home/include"
|
||||
sharedLibraryFile = file("$mysql32Home/lib/$dllName")
|
||||
sharedLibraryLinkFile = file("$mysql32Home/lib/$linkName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$mysql64Home/include"
|
||||
sharedLibraryFile = file("$mysql64Home/lib/$dllName")
|
||||
sharedLibraryLinkFile = file("$mysql64Home/lib/$linkName")
|
||||
}
|
||||
} else
|
||||
if (buildType == buildTypes.release) {
|
||||
dllName = 'libmysql.dll'
|
||||
linkName = 'libmysql.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$mysql32Home/include"
|
||||
sharedLibraryFile = file("$mysql32Home/lib/$dllName")
|
||||
sharedLibraryLinkFile = file("$mysql32Home/lib/$linkName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$mysql64Home/include"
|
||||
sharedLibraryFile = file("$mysql64Home/lib/$dllName")
|
||||
sharedLibraryLinkFile = file("$mysql64Home/lib/$linkName")
|
||||
}
|
||||
} else {
|
||||
throw new GradleException("Unknown buildType" + buildType)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
components {
|
||||
SQLMySQL(NativeLibrarySpec) {
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'include'
|
||||
}
|
||||
lib library: 'mysql'
|
||||
lib project: ':SQL', library: 'SQL'
|
||||
lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
cppCompiler.define "THREADSAFE"
|
||||
cppCompiler.define "__LCC__"
|
||||
cppCompiler.define "WINVER=0x0600"
|
||||
}
|
||||
withType(SharedLibraryBinarySpec) {
|
||||
if (toolChain in VisualCpp) {
|
||||
cppCompiler.define "MySQL_EXPORTS"
|
||||
}
|
||||
}
|
||||
withType(StaticLibraryBinarySpec) {
|
||||
}
|
||||
}
|
||||
}
|
||||
task poco { dependsOn "assemble" }
|
||||
|
||||
|
||||
73
SQL/MySQL/testsuite/build.gradle
Normal file
73
SQL/MySQL/testsuite/build.gradle
Normal file
@@ -0,0 +1,73 @@
|
||||
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) {
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.cpp'
|
||||
exclude '*Driver.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'src'
|
||||
}
|
||||
lib project: ':CppUnit', library: 'CppUnit', linkage: 'shared'
|
||||
lib project: ':SQL:MySQL', library: 'mysql', linkage: 'shared'
|
||||
lib project: ':SQL:MySQL', library: 'SQLMySQL', linkage: 'shared'
|
||||
lib project: ':SQL', library: 'SQL', linkage: 'shared'
|
||||
lib project: ':Util', library: 'Util'
|
||||
lib project: ':JSON', library: 'JSON'
|
||||
lib project: ':XML', library: 'XML'
|
||||
lib project: ':Foundation', library: 'Foundation', linkage: 'shared'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
testSuites {
|
||||
MySQLTestSuite(org.gradle.nativeplatform.test.cppunit.CppUnitTestSuiteSpec) {
|
||||
testing $.components.TestSuite
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
cppCompiler.define "THREADSAFE"
|
||||
cppCompiler.define "__LCC__"
|
||||
cppCompiler.define "WINVER=0x0600"
|
||||
}
|
||||
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" }
|
||||
|
||||
46
SQL/ODBC/build.gradle
Normal file
46
SQL/ODBC/build.gradle
Normal file
@@ -0,0 +1,46 @@
|
||||
model {
|
||||
components {
|
||||
SQLODBC(NativeLibrarySpec) {
|
||||
sources {
|
||||
rc {
|
||||
source {
|
||||
srcDir '../..'
|
||||
include 'DLLVersion.rc'
|
||||
}
|
||||
}
|
||||
cpp {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.cpp'
|
||||
exclude 'Unicode_WIN32.cpp'
|
||||
exclude 'Unicode_UNIXODBC.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'include'
|
||||
}
|
||||
lib project: ':SQL', library: 'SQL'
|
||||
lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
if (toolChain in VisualCpp) {
|
||||
cppCompiler.define "THREADSAFE=1"
|
||||
}
|
||||
}
|
||||
withType(SharedLibraryBinarySpec) {
|
||||
if (toolChain in VisualCpp) {
|
||||
cppCompiler.define "ODBC_EXPORTS"
|
||||
linker.args 'odbc32.lib'
|
||||
linker.args 'odbccp32.lib'
|
||||
}
|
||||
}
|
||||
withType(StaticLibraryBinarySpec) {
|
||||
}
|
||||
}
|
||||
}
|
||||
task poco { dependsOn "assemble" }
|
||||
|
||||
|
||||
69
SQL/ODBC/testsuite/build.gradle
Normal file
69
SQL/ODBC/testsuite/build.gradle
Normal file
@@ -0,0 +1,69 @@
|
||||
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) {
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.cpp'
|
||||
exclude '*Driver.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'src'
|
||||
}
|
||||
lib project: ':CppUnit', library: 'CppUnit', linkage: 'shared'
|
||||
lib project: ':SQL:ODBC', library: 'SQLODBC', linkage: 'shared'
|
||||
lib project: ':SQL', library: 'SQL', linkage: 'shared'
|
||||
lib project: ':Foundation', library: 'Foundation', linkage: 'shared'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
testSuites {
|
||||
ODBCTestSuite(org.gradle.nativeplatform.test.cppunit.CppUnitTestSuiteSpec) {
|
||||
testing $.components.TestSuite
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
if (toolChain in VisualCpp) {
|
||||
linker.args 'odbc32.lib'
|
||||
linker.args 'odbccp32.lib'
|
||||
}
|
||||
}
|
||||
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" }
|
||||
233
SQL/PostgreSQL/build.gradle
Normal file
233
SQL/PostgreSQL/build.gradle
Normal file
@@ -0,0 +1,233 @@
|
||||
model {
|
||||
repositories {
|
||||
libs(PrebuiltLibraries) {
|
||||
intl {
|
||||
binaries.withType(StaticLibraryBinary) {
|
||||
def libName = "foobar"
|
||||
if (buildType == buildTypes.debug) {
|
||||
libName = 'libintl.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$postgres32Home/include"
|
||||
staticLibraryFile = file("$postgres32Home/lib/$libName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$postgres64Home/include"
|
||||
staticLibraryFile = file("$postgres64Home/lib/$libName")
|
||||
}
|
||||
} else
|
||||
if (buildType == buildTypes.release) {
|
||||
libName = 'libintl.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$postgres32Home/include"
|
||||
staticLibraryFile = file("$postgres32Home/lib/$libName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$postgres64Home/include"
|
||||
staticLibraryFile = file("$postgres64Home/lib/$libName")
|
||||
}
|
||||
} else {
|
||||
throw new GradleException("Unknown buildType" + buildType)
|
||||
}
|
||||
}
|
||||
binaries.withType(SharedLibraryBinary) {
|
||||
def dllName
|
||||
def linkName
|
||||
if (buildType == buildTypes.debug) {
|
||||
dllName = 'libintl-8.dll'
|
||||
linkName = 'libintl.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$postgres32Home/include"
|
||||
sharedLibraryFile = file("$postgres32Home/bin/$dllName")
|
||||
sharedLibraryLinkFile = file("$postgres32Home/lib/$linkName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$postgres64Home/include"
|
||||
sharedLibraryFile = file("$postgres64Home/bin/$dllName")
|
||||
sharedLibraryLinkFile = file("$postgres64Home/lib/$linkName")
|
||||
}
|
||||
} else
|
||||
if (buildType == buildTypes.release) {
|
||||
dllName = 'libintl-8.dll'
|
||||
linkName = 'libintl.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$postgres32Home/include"
|
||||
sharedLibraryFile = file("$postgres32Home/bin/$dllName")
|
||||
sharedLibraryLinkFile = file("$postgres32Home/lib/$linkName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$postgres64Home/include"
|
||||
sharedLibraryFile = file("$postgres64Home/bin/$dllName")
|
||||
sharedLibraryLinkFile = file("$postgres64Home/lib/$linkName")
|
||||
}
|
||||
} else {
|
||||
throw new GradleException("Unknown buildType" + buildType)
|
||||
}
|
||||
}
|
||||
}
|
||||
iconv {
|
||||
binaries.withType(StaticLibraryBinary) {
|
||||
def libName = "foobar"
|
||||
if (buildType == buildTypes.debug) {
|
||||
libName = 'iconv.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$postgres32Home/include"
|
||||
staticLibraryFile = file("$postgres32Home/lib/$libName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$postgres64Home/include"
|
||||
staticLibraryFile = file("$postgres64Home/lib/$libName")
|
||||
}
|
||||
} else
|
||||
if (buildType == buildTypes.release) {
|
||||
libName = 'iconv.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$postgres32Home/include"
|
||||
staticLibraryFile = file("$postgres32Home/lib/$libName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$postgres64Home/include"
|
||||
staticLibraryFile = file("$postgres64Home/lib/$libName")
|
||||
}
|
||||
} else {
|
||||
throw new GradleException("Unknown buildType" + buildType)
|
||||
}
|
||||
}
|
||||
binaries.withType(SharedLibraryBinary) {
|
||||
def dllName
|
||||
def linkName
|
||||
if (buildType == buildTypes.debug) {
|
||||
dllName = 'libiconv-2.dll'
|
||||
linkName = 'iconv.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$postgres32Home/include"
|
||||
sharedLibraryFile = file("$postgres32Home/bin/$dllName")
|
||||
sharedLibraryLinkFile = file("$postgres32Home/lib/$linkName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$postgres64Home/include"
|
||||
sharedLibraryFile = file("$postgres64Home/bin/$dllName")
|
||||
sharedLibraryLinkFile = file("$postgres64Home/lib/$linkName")
|
||||
}
|
||||
} else
|
||||
if (buildType == buildTypes.release) {
|
||||
dllName = 'libiconv-2.dll'
|
||||
linkName = 'iconv.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$postgres32Home/include"
|
||||
sharedLibraryFile = file("$postgres32Home/bin/$dllName")
|
||||
sharedLibraryLinkFile = file("$postgres32Home/lib/$linkName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$postgres64Home/include"
|
||||
sharedLibraryFile = file("$postgres64Home/bin/$dllName")
|
||||
sharedLibraryLinkFile = file("$postgres64Home/lib/$linkName")
|
||||
}
|
||||
} else {
|
||||
throw new GradleException("Unknown buildType" + buildType)
|
||||
}
|
||||
}
|
||||
}
|
||||
postgres {
|
||||
binaries.withType(StaticLibraryBinary) {
|
||||
def libName = "foobar"
|
||||
if (buildType == buildTypes.debug) {
|
||||
libName = 'libpq.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$postgres32Home/include"
|
||||
staticLibraryFile = file("$postgres32Home/lib/$libName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$postgres64Home/include"
|
||||
staticLibraryFile = file("$postgres64Home/lib/$libName")
|
||||
}
|
||||
} else
|
||||
if (buildType == buildTypes.release) {
|
||||
libName = 'libpq.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$postgres32Home/include"
|
||||
staticLibraryFile = file("$postgres32Home/lib/$libName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$postgres64Home/include"
|
||||
staticLibraryFile = file("$postgres64Home/lib/$libName")
|
||||
}
|
||||
} else {
|
||||
throw new GradleException("Unknown buildType" + buildType)
|
||||
}
|
||||
}
|
||||
binaries.withType(SharedLibraryBinary) {
|
||||
def dllName
|
||||
def linkName
|
||||
if (buildType == buildTypes.debug) {
|
||||
dllName = 'libpq.dll'
|
||||
linkName = 'libpq.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$postgres32Home/include"
|
||||
sharedLibraryFile = file("$postgres32Home/lib/$dllName")
|
||||
sharedLibraryLinkFile = file("$postgres32Home/lib/$linkName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$postgres64Home/include"
|
||||
sharedLibraryFile = file("$postgres64Home/lib/$dllName")
|
||||
sharedLibraryLinkFile = file("$postgres64Home/lib/$linkName")
|
||||
}
|
||||
} else
|
||||
if (buildType == buildTypes.release) {
|
||||
dllName = 'libpq.dll'
|
||||
linkName = 'libpq.lib'
|
||||
if (targetPlatform.name == 'win32') {
|
||||
headers.srcDir "$postgres32Home/include"
|
||||
sharedLibraryFile = file("$postgres32Home/lib/$dllName")
|
||||
sharedLibraryLinkFile = file("$postgres32Home/lib/$linkName")
|
||||
} else
|
||||
if (targetPlatform.name == 'win64') {
|
||||
headers.srcDir "$postgres64Home/include"
|
||||
sharedLibraryFile = file("$postgres64Home/lib/$dllName")
|
||||
sharedLibraryLinkFile = file("$postgres64Home/lib/$linkName")
|
||||
}
|
||||
} else {
|
||||
throw new GradleException("Unknown buildType" + buildType)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
components {
|
||||
SQLPostgreSQL(NativeLibrarySpec) {
|
||||
sources {
|
||||
rc {
|
||||
source {
|
||||
srcDir '../..'
|
||||
include 'DLLVersion.rc'
|
||||
}
|
||||
}
|
||||
cpp {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'include'
|
||||
}
|
||||
lib library: 'postgres'
|
||||
lib project: ':SQL', library: 'SQL'
|
||||
lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
}
|
||||
withType(SharedLibraryBinarySpec) {
|
||||
if (toolChain in VisualCpp) {
|
||||
cppCompiler.define "PostgreSQL_EXPORTS"
|
||||
}
|
||||
}
|
||||
withType(StaticLibraryBinarySpec) {
|
||||
}
|
||||
}
|
||||
}
|
||||
task poco { dependsOn "assemble" }
|
||||
|
||||
|
||||
66
SQL/PostgreSQL/testsuite/build.gradle
Normal file
66
SQL/PostgreSQL/testsuite/build.gradle
Normal file
@@ -0,0 +1,66 @@
|
||||
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) {
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.cpp'
|
||||
exclude '*Driver.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'src'
|
||||
}
|
||||
lib project: ':CppUnit', library: 'CppUnit'
|
||||
lib project: ':SQL:PostgreSQL', library: 'SQLPostgreSQL'
|
||||
lib project: ':SQL:PostgreSQL', library: 'postgres'
|
||||
lib project: ':SQL:PostgreSQL', library: 'intl'
|
||||
lib project: ':SQL:PostgreSQL', library: 'iconv'
|
||||
lib project: ':SQL', library: 'SQL'
|
||||
lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
testSuites {
|
||||
PostgreSQLTestSuite(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" }
|
||||
69
SQL/SQLite/build.gradle
Normal file
69
SQL/SQLite/build.gradle
Normal file
@@ -0,0 +1,69 @@
|
||||
model {
|
||||
components {
|
||||
SQLSQLite(NativeLibrarySpec) {
|
||||
sources {
|
||||
rc {
|
||||
source {
|
||||
srcDir '../..'
|
||||
include 'DLLVersion.rc'
|
||||
}
|
||||
}
|
||||
c {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.c'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'include'
|
||||
}
|
||||
lib project: ':SQL', library: 'SQL'
|
||||
lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
cpp {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'include'
|
||||
}
|
||||
lib project: ':SQL', library: 'SQL'
|
||||
lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
if (toolChain in VisualCpp) {
|
||||
cCompiler.define "SQLITE_THREADSAFE=1"
|
||||
cCompiler.define "SQLITE_ENABLE_FTS3"
|
||||
cCompiler.define "SQLITE_ENABLE_FTS3_PARENTHESIS"
|
||||
cCompiler.define "SQLITE_OMIT_UTF16"
|
||||
cCompiler.define "SQLITE_OMIT_PROGRESS_CALLBACK"
|
||||
cCompiler.define "SQLITE_OMIT_COMPLETE"
|
||||
cCompiler.define "SQLITE_OMIT_TCL_VARIABLE"
|
||||
cCompiler.define "SQLITE_OMIT_DEPRECATED"
|
||||
|
||||
cppCompiler.define "SQLITE_THREADSAFE=1"
|
||||
cppCompiler.define "SQLITE_ENABLE_FTS3"
|
||||
cppCompiler.define "SQLITE_ENABLE_FTS3_PARENTHESIS"
|
||||
cppCompiler.define "SQLITE_OMIT_UTF16"
|
||||
cppCompiler.define "SQLITE_OMIT_PROGRESS_CALLBACK"
|
||||
cppCompiler.define "SQLITE_OMIT_COMPLETE"
|
||||
cppCompiler.define "SQLITE_OMIT_TCL_VARIABLE"
|
||||
cppCompiler.define "SQLITE_OMIT_DEPRECATED"
|
||||
}
|
||||
}
|
||||
withType(SharedLibraryBinarySpec) {
|
||||
if (toolChain in VisualCpp) {
|
||||
cppCompiler.define "SQLite_EXPORTS"
|
||||
}
|
||||
}
|
||||
withType(StaticLibraryBinarySpec) {
|
||||
}
|
||||
}
|
||||
}
|
||||
task poco { dependsOn "assemble" }
|
||||
|
||||
|
||||
64
SQL/SQLite/testsuite/build.gradle
Normal file
64
SQL/SQLite/testsuite/build.gradle
Normal file
@@ -0,0 +1,64 @@
|
||||
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) {
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.cpp'
|
||||
exclude '*Driver.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'src'
|
||||
}
|
||||
lib project: ':CppUnit', library: 'CppUnit', linkage: 'shared'
|
||||
lib project: ':SQL:SQLite', library: 'SQLSQLite', linkage: 'shared'
|
||||
lib project: ':SQL', library: 'SQL', linkage: 'shared'
|
||||
lib project: ':Foundation', library: 'Foundation', linkage: 'shared'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
testSuites {
|
||||
SQLiteTestSuite(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" }
|
||||
|
||||
35
SQL/build.gradle
Normal file
35
SQL/build.gradle
Normal file
@@ -0,0 +1,35 @@
|
||||
model {
|
||||
components {
|
||||
SQL(NativeLibrarySpec) {
|
||||
sources {
|
||||
rc {
|
||||
source {
|
||||
srcDir '..'
|
||||
include 'DLLVersion.rc'
|
||||
}
|
||||
}
|
||||
cpp {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'include'
|
||||
}
|
||||
lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
}
|
||||
withType(SharedLibraryBinarySpec) {
|
||||
if (toolChain in VisualCpp) {
|
||||
cppCompiler.define "SQL_EXPORTS"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
task poco { dependsOn "assemble" }
|
||||
|
||||
69
SQL/samples/build.gradle
Normal file
69
SQL/samples/build.gradle
Normal file
@@ -0,0 +1,69 @@
|
||||
model {
|
||||
components {
|
||||
Binding(NativeExecutableSpec) {
|
||||
sources {
|
||||
cpp.source { srcDir 'Binding/src' include '**/*.cpp' }
|
||||
cpp.lib project: ':SQL', library: 'SQL'
|
||||
cpp.lib project: ':SQL:SQLite', library: 'SQLSQLite'
|
||||
cpp.lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
RecordSet(NativeExecutableSpec) {
|
||||
sources {
|
||||
cpp.source { srcDir 'RecordSet/src' include '**/*.cpp' }
|
||||
cpp.lib project: ':SQL', library: 'SQL'
|
||||
cpp.lib project: ':SQL:SQLite', library: 'SQLSQLite'
|
||||
cpp.lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
RowFormatter(NativeExecutableSpec) {
|
||||
sources {
|
||||
cpp.source { srcDir 'RowFormatter/src' include '**/*.cpp' }
|
||||
cpp.lib project: ':SQL', library: 'SQL'
|
||||
cpp.lib project: ':SQL:SQLite', library: 'SQLSQLite'
|
||||
cpp.lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
Tuple(NativeExecutableSpec) {
|
||||
sources {
|
||||
cpp.source { srcDir 'Tuple/src' include '**/*.cpp' }
|
||||
cpp.lib project: ':SQL', library: 'SQL'
|
||||
cpp.lib project: ':SQL:SQLite', library: 'SQLSQLite'
|
||||
cpp.lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
TypeHandler(NativeExecutableSpec) {
|
||||
sources {
|
||||
cpp.source { srcDir 'TypeHandler/src' include '**/*.cpp' }
|
||||
cpp.lib project: ':SQL', library: 'SQL'
|
||||
cpp.lib project: ':SQL:SQLite', library: 'SQLSQLite'
|
||||
cpp.lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
WebNotifier(NativeExecutableSpec) {
|
||||
sources {
|
||||
cpp.source { srcDir 'WebNotifier/src' include '**/*.cpp' }
|
||||
cpp.lib project: ':SQL', library: 'SQL'
|
||||
cpp.lib project: ':SQL:SQLite', library: 'SQLSQLite'
|
||||
cpp.lib project: ':Net', library: 'Net'
|
||||
cpp.lib project: ':Foundation', library: 'Foundation'
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
}
|
||||
withType(SharedLibraryBinarySpec) {
|
||||
lib project: ':Foundation', library: 'Foundation', linkage: 'shared'
|
||||
}
|
||||
withType(StaticLibraryBinarySpec) {
|
||||
lib project: ':Foundation', library: 'Foundation', linkage: 'static'
|
||||
}
|
||||
withType(NativeExecutableSpec) {
|
||||
lib project: ':Foundation', library: 'Foundation', linkage: 'static'
|
||||
}
|
||||
}
|
||||
}
|
||||
task samples { dependsOn "assemble" }
|
||||
|
||||
|
||||
65
SQL/testsuite/build.gradle
Normal file
65
SQL/testsuite/build.gradle
Normal file
@@ -0,0 +1,65 @@
|
||||
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) {
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDir 'src'
|
||||
include '**/*.cpp'
|
||||
exclude '*Driver.cpp'
|
||||
exclude 'StatementImpl.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'src'
|
||||
}
|
||||
lib project: ':CppUnit', library: 'CppUnit', linkage: 'shared'
|
||||
lib project: ':SQL', library: 'SQL', linkage: 'shared'
|
||||
lib project: ':Foundation', library: 'Foundation', linkage: 'shared'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
testSuites {
|
||||
SQLTestSuite(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" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user