mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
This will allow dependencies such as wpilibc to update to use wpiutil without breaking "normal" ntcore static library use in the meantime. This commit also restructures the gradle files by creating a new (placeholder) wpiutil project, and moving the ntcore project into a separate gradle file. Added toolchains/native.gradle (refactored from ntcore). Also fixes ntcore skipJava on Windows by providing an alternate .def file for this case.
43 lines
1.4 KiB
Groovy
43 lines
1.4 KiB
Groovy
apply plugin: 'google-test'
|
|
|
|
model {
|
|
testSuites {
|
|
ntcoreTest {
|
|
if (!project.hasProperty('skipJava')) {
|
|
setupJniIncludes(binaries)
|
|
}
|
|
sources {
|
|
cpp {
|
|
source {
|
|
srcDirs = ["${rootDir}/test/unit"]
|
|
includes = ['**/*.cpp']
|
|
}
|
|
exportedHeaders {
|
|
srcDirs = ["${rootDir}/include", "${rootDir}/src", "${rootDir}/wpiutil/include", "${rootDir}/gmock/include", "${rootDir}/gmock/gtest/include"]
|
|
includes = ['**/*.h']
|
|
}
|
|
}
|
|
}
|
|
binaries.all {
|
|
lib project: ':gmock', library: 'gmock', linkage: 'static'
|
|
lib library: 'ntcore', linkage: 'static'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
model {
|
|
binaries {
|
|
withType(GoogleTestTestSuiteBinarySpec) {
|
|
lib project: ':gmock', library: "gmock", linkage: "static"
|
|
lib library: 'ntcore', 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'
|
|
}
|
|
}
|
|
}
|
|
}
|