poco/Data/ODBC/build.gradle
2018-09-24 21:46:23 +02:00

78 lines
2.0 KiB
Groovy

model {
components {
DataODBC(NativeLibrarySpec) { m ->
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: ':Data', library: 'Data'
lib project: ':Foundation', library: 'Foundation'
}
}
/*
binaries.all {
sources {
if (targetPlatform.operatingSystem.windows) {
platformWindows(CppSourceSet) {
lib m.sources.cpp
source {
srcDir 'src'
include 'Unicode_WIN32.cpp'
}
lib project: ':Foundation', library: 'Foundation'
}
} else
if (targetPlatform.operatingSystem.macOsX || targetPlatform.operatingSystem.linux) {
platformNix(CppSourceSet) {
lib m.sources.cpp
source {
srcDir 'src'
include 'Unicode_UNIXODBC.cpp'
}
lib project: ':Foundation', library: 'Foundation'
}
}
}
}
*/
}
}
binaries {
all {
if (toolChain in VisualCpp) {
cppCompiler.define "THREADSAFE=1"
}
if (toolChain in Gcc || toolChain in Clang) {
cppCompiler.define "POCO_UNIXODBC"
linker.args "-lodbc"
}
}
withType(SharedLibraryBinarySpec) {
if (toolChain in VisualCpp) {
cppCompiler.define "ODBC_EXPORTS"
linker.args 'odbc32.lib'
linker.args 'odbccp32.lib'
}
}
withType(StaticLibraryBinarySpec) {
}
}
}
task poco { dependsOn "assemble" }