mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
50 lines
1.7 KiB
Groovy
50 lines
1.7 KiB
Groovy
apply plugin: 'google-test'
|
|
|
|
model {
|
|
testSuites {
|
|
cameraserverTest {
|
|
if (!project.hasProperty('skipJava')) {
|
|
setupJniIncludes(binaries)
|
|
}
|
|
sources {
|
|
cpp {
|
|
source {
|
|
srcDirs = ["${rootDir}/test/unit"]
|
|
includes = ['**/*.cpp']
|
|
}
|
|
exportedHeaders {
|
|
srcDirs = ["${rootDir}/include", "${rootDir}/src", "${rootDir}/gmock/include", "${rootDir}/gmock/gtest/include"]
|
|
includes = ['**/*.h']
|
|
}
|
|
}
|
|
}
|
|
binaries.all {
|
|
lib project: ':gmock', library: 'gmock', linkage: 'static'
|
|
lib library: 'cameraserver', linkage: 'static'
|
|
tasks.withType(CppCompile) {
|
|
project.addWpiUtilLibraryLinks(it, linker, targetPlatform)
|
|
project.addOpenCvLibraryLinks(it, linker, targetPlatform)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
model {
|
|
binaries {
|
|
withType(GoogleTestTestSuiteBinarySpec) {
|
|
lib project: ':gmock', library: "gmock", linkage: "static"
|
|
lib library: 'cameraserver', linkage: 'static'
|
|
tasks.withType(CppCompile) {
|
|
project.addWpiUtilLibraryLinks(it, linker, targetPlatform)
|
|
}
|
|
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'
|
|
}
|
|
}
|
|
}
|
|
}
|