mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
The wpimath library is a new library designed to separate the reusable math functionality from the common utility library (wpiutil) and the hardware-dependent library (wpilibc/j). Package names / include file names were NOT changed to minimize breakage. In a future year it would be good to revamp these for a more uniform user experience and to reduce the risk of accidental naming conflicts. While theoretically all of this functionality could be placed into wpiutil, several pieces of this library (e.g. DARE) are very time-consuming to compile, so it's nice to avoid this expense for users who only want cscore or ntcore. It also allows for easy future separation of build tasks vs number of workers on memory-constrained machines. This moves the following functionality from wpiutil into wpimath: - Eigen - ejml - Drake - DARE - wpiutil.math package (Matrix etc) - units And the following functionality from wpilibc/j into wpimath: - Geometry - Kinematics - Spline - Trajectory - LinearFilter - MedianFilter - Feed-forward controllers
105 lines
4.2 KiB
Groovy
105 lines
4.2 KiB
Groovy
import org.gradle.language.base.internal.ProjectLayout
|
|
|
|
apply plugin: 'cpp'
|
|
apply plugin: 'visual-studio'
|
|
apply plugin: 'edu.wpi.first.NativeUtils'
|
|
apply plugin: ExtraTasks
|
|
|
|
apply from: '../shared/config.gradle'
|
|
|
|
ext {
|
|
sharedCvConfigs = [wpilibcIntegrationTests: []]
|
|
staticCvConfigs = [:]
|
|
useJava = false
|
|
useCpp = true
|
|
staticGtestConfigs = [wpilibcIntegrationTests: []]
|
|
}
|
|
|
|
apply from: "${rootDir}/shared/opencv.gradle"
|
|
|
|
apply from: "${rootDir}/shared/googletest.gradle"
|
|
|
|
model {
|
|
components {
|
|
wpilibcIntegrationTests(NativeExecutableSpec) {
|
|
targetBuildTypes 'debug'
|
|
baseName = 'FRCUserProgram'
|
|
nativeUtils.useRequiredLibrary(it, 'googletest_static')
|
|
binaries.all { binary ->
|
|
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
|
binary.sources {
|
|
athenaCpp(CppSourceSet) {
|
|
source {
|
|
srcDirs = ['src/main/native/cpp']
|
|
includes = ['**/*.cpp']
|
|
}
|
|
exportedHeaders {
|
|
srcDirs = ['src/main/native/include']
|
|
includes = ['**/*.h']
|
|
}
|
|
}
|
|
}
|
|
binary.tasks.withType(CppCompile) {
|
|
cppCompiler.args "-Wno-missing-field-initializers"
|
|
cppCompiler.args "-Wno-unused-variable"
|
|
cppCompiler.args "-Wno-error=deprecated-declarations"
|
|
}
|
|
lib project: ':wpilibOldCommands', library: 'wpilibOldCommands', linkage: 'shared'
|
|
lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
|
|
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
|
|
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
|
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
|
lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
|
|
lib project: ':cscore', library: 'cscoreJNIShared', linkage: 'shared'
|
|
project(':hal').addHalDependency(binary, 'shared')
|
|
project(':hal').addHalJniDependency(binary)
|
|
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
|
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
|
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
|
nativeUtils.useRequiredLibrary(binary, 'netcomm_shared', 'chipobject_shared', 'visa_shared', 'ni_runtime_shared')
|
|
}
|
|
} else {
|
|
binary.sources {
|
|
simCpp(CppSourceSet) {
|
|
source {
|
|
srcDirs 'src/main/native/dt'
|
|
includes = ['**/*.cpp']
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
def testOutputFolder = file("${project(':').buildDir}/integrationTestFiles")
|
|
|
|
model {
|
|
tasks {
|
|
copyWpilibCTestLibrariesToOutput(Copy) {
|
|
def task = it
|
|
$.binaries.each {
|
|
if (it in NativeExecutableBinarySpec && it.targetPlatform.name == nativeUtils.wpi.platforms.roborio && it.buildable) {
|
|
def installTask = it.tasks.install
|
|
task.dependsOn installTask
|
|
task.from(installTask.executableFile) {
|
|
into '/cpp'
|
|
}
|
|
installTask.libs.each {
|
|
task.from(it) {
|
|
into '/libs'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
destinationDir testOutputFolder
|
|
}
|
|
// This is in a separate if statement because of what I would assume is a bug in grade.
|
|
// Will file an issue on their side.
|
|
if (!project.hasProperty('skiponlyathena')) {
|
|
build.dependsOn copyWpilibCTestLibrariesToOutput
|
|
}
|
|
}
|
|
}
|