mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
46 lines
1.4 KiB
Groovy
46 lines
1.4 KiB
Groovy
apply plugin: 'google-test'
|
|
task check() {}
|
|
|
|
model {
|
|
testSuites {
|
|
ntcoreTest {
|
|
if (!project.hasProperty('skipJava')) {
|
|
setupJniIncludes(binaries)
|
|
}
|
|
sources {
|
|
cpp {
|
|
source {
|
|
srcDirs = ['test/unit']
|
|
includes = ['**/*.cpp']
|
|
}
|
|
exportedHeaders {
|
|
srcDirs = ['include', 'src', 'gmock/include', 'gmock/gtest/include']
|
|
includes = ['**/*.h']
|
|
}
|
|
}
|
|
}
|
|
binaries.all {
|
|
if (project.hasProperty('wpilib')) {
|
|
lib project: ':ntcore:gmock', library: "gmock", linkage: "static"
|
|
} else {
|
|
lib project: ':gmock', library: "gmock", linkage: "static"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
binaries.withType(GoogleTestTestSuiteBinarySpec) {
|
|
if (project.hasProperty('wpilib')) {
|
|
lib project: ':ntcore:gmock', library: "gmock", linkage: "static"
|
|
} else {
|
|
lib project: ':gmock', library: "gmock", linkage: "static"
|
|
}
|
|
if (targetPlatform.operatingSystem.windows) {
|
|
cppCompiler.args '/EHsc', '/DNOMINMAX', '/D_SCL_SECURE_NO_WARNINGS', '/D_WINSOCK_DEPRECATED_NO_WARNINGS'
|
|
} else {
|
|
cppCompiler.args '-pthread', '-std=c++1y'
|
|
linker.args '-pthread'
|
|
}
|
|
}
|