Files
allwpilib/myRobotCpp/build.gradle
Thad House 81212d80c6 Fixes ultrasonic declaration (#328)
Also adds test to ensure this doens't happen again
2016-11-04 15:02:29 -07:00

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'
}
}
}
}
}