FalconLibraryCPP/build.gradle
2019-06-26 14:47:47 -04:00

64 lines
1.7 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"
}
}
}
}
binaries {
withType(GoogleTestTestSuiteBinarySpec) {
lib project: ":libs", library: "googleTest", 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"
}
}
}
}
}