mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
75 lines
2.8 KiB
Groovy
75 lines
2.8 KiB
Groovy
apply plugin: 'cpp'
|
|
|
|
defineNetworkTablesProperties()
|
|
defineWpiUtilProperties()
|
|
|
|
ext.shared = "${project(':wpilibc').projectDir.getAbsolutePath()}/shared"
|
|
ext.athena = "${project(':wpilibc').projectDir.getAbsolutePath()}/athena"
|
|
ext.hal = project(':hal').projectDir.getAbsolutePath()
|
|
|
|
model {
|
|
components {
|
|
myRobotcpp(NativeExecutableSpec) {
|
|
targetPlatform 'arm'
|
|
binaries.all {
|
|
tasks.withType(CppCompile) {
|
|
addNiLibraryLinks(linker, targetPlatform)
|
|
addStaticNetworkTablesLibraryLinks(it, linker, targetPlatform)
|
|
}
|
|
|
|
cppCompiler.args '-pthread', '-Wno-unused-variable'
|
|
linker.args '-pthread', '-Wno-unused-variable', '-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a'
|
|
}
|
|
sources {
|
|
cpp {
|
|
source {
|
|
srcDir 'src'
|
|
include '**/*.cpp'
|
|
}
|
|
exportedHeaders {
|
|
srcDirs = ['include',
|
|
"${project.athena}/include", "${project.shared}/include",
|
|
"${project.hal}/include/HAL", netTablesInclude, wpiUtilInclude]
|
|
include '**/*.h'
|
|
}
|
|
|
|
lib project: ':wpilibc', library: 'wpilibc', linkage: 'static'
|
|
lib project: ':hal', library: 'HALAthena', linkage: 'static'
|
|
}
|
|
}
|
|
}
|
|
|
|
// Shared target used just to check that wpilib is fully linked
|
|
// Use the static target for normal linking
|
|
myRobotcppShared(NativeExecutableSpec) {
|
|
targetPlatform 'arm'
|
|
binaries.all {
|
|
tasks.withType(CppCompile) {
|
|
addNiLibraryLinks(linker, targetPlatform)
|
|
addNetworkTablesLibraryLinks(it, linker, targetPlatform)
|
|
}
|
|
|
|
cppCompiler.args '-pthread', '-Wno-unused-variable'
|
|
linker.args '-pthread', '-Wno-unused-variable', '-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a'
|
|
}
|
|
sources {
|
|
cpp {
|
|
source {
|
|
srcDir 'src'
|
|
include '**/*.cpp'
|
|
}
|
|
exportedHeaders {
|
|
srcDirs = ['include',
|
|
"${project.athena}/include", "${project.shared}/include",
|
|
"${project.hal}/include/HAL", netTablesInclude, wpiUtilInclude]
|
|
include '**/*.h'
|
|
}
|
|
|
|
lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
|
|
lib project: ':hal', library: 'HALAthena', linkage: 'shared'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|