66 lines
1.9 KiB
Groovy
66 lines
1.9 KiB
Groovy
plugins {
|
|
id "cpp"
|
|
id "google-test-test-suite"
|
|
id "visual-studio"
|
|
}
|
|
|
|
model {
|
|
components {
|
|
falconlibrary(NativeLibrarySpec) {
|
|
sources.cpp {
|
|
source {
|
|
srcDir "src/cpp"
|
|
include "**/*.cpp"
|
|
}
|
|
exportedHeaders {
|
|
srcDir "src/include"
|
|
include "**/*.h"
|
|
}
|
|
lib project: ':libs', library: 'units', linkage: 'static'
|
|
}
|
|
}
|
|
}
|
|
binaries {
|
|
withType(GoogleTestTestSuiteBinarySpec) {
|
|
lib project: ":libs", library: "googleTest", linkage: "static"
|
|
lib project: ':libs', library: 'units', linkage: 'static'
|
|
}
|
|
}
|
|
testSuites {
|
|
falconlibraryBench(GoogleTestTestSuiteSpec) {
|
|
testing $.components.falconlibrary
|
|
|
|
binaries.all {
|
|
if (toolChain instanceof GccCompatibleToolChain) {
|
|
linker.args << '-pthread'
|
|
} else {
|
|
// MSVC
|
|
linker.args << 'shlwapi.lib'
|
|
}
|
|
if (!project.hasProperty("withBench"))
|
|
tasks.withType(RunTestExecutable) { RunTestExecutable task ->
|
|
task.enabled = false
|
|
}
|
|
}
|
|
|
|
sources.cpp {
|
|
source {
|
|
srcDir 'src/bench'
|
|
include '**/*.cpp'
|
|
}
|
|
lib project: ':libs', library: 'googleBench', linkage: 'static'
|
|
}
|
|
}
|
|
|
|
falconlibraryTest(GoogleTestTestSuiteSpec) {
|
|
testing $.components.falconlibrary
|
|
|
|
sources.cpp {
|
|
source {
|
|
srcDir "src/test/cpp"
|
|
include "**/*.cpp"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |