poco/Data/ODBC/build.gradle
2018-05-02 22:25:50 +02:00

68 lines
1.6 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'
}
}
} else
if (targetPlatform.operatingSystem.macOsX || targetPlatform.operatingSystem.linux) {
platformNix(CppSourceSet) {
lib m.sources.cpp
source {
srcDir 'src'
include 'Unicode_UNIXODBC.cpp'
}
}
}
}
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" }