Files
allwpilib/myRobotCpp/build.gradle
Jaci R a42ec08d16 Fix RoboRIO Cross-Toolchain GCC Status (#405)
* Dedicated RoboRIO Toolchain, allow Toolchain Path to change

* Add cCompiler Tool to correctly discover RoboRIO GCC on Mac

* Add @333fred requests for GString and ToolChainPath

* Add Toolchain Path option to README
2016-12-21 19:56:28 -08:00

112 lines
3.0 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 'roborio-arm'
binaries.all {
tasks.withType(CppCompile) {
addNiLibraryLinks(linker, targetPlatform)
addNetworkTablesLibraryLinks(it, linker, targetPlatform)
addCsCoreLibraryLinks(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'
}
}
}
}
}
def nativeDirectory = "$buildDir/output"
clean {
delete nativeDirectory
}
task copyRobotLibraries(type: Copy) {
description = 'Copies all native libraries to an easy to find folder'
group = 'WPILib'
destinationDir = file(nativeDirectory)
dependsOn ':hal:build'
dependsOn ':wpilibc:build'
dependsOn check
project(':wpilibc').model {
binaries {
withType(SharedLibraryBinarySpec) { spec ->
from(spec.sharedLibraryFile) {
into '/'
}
}
}
}
project.model {
binaries {
withType(NativeExecutableBinarySpec) { spec ->
from(spec.executableFile) {
into '/'
}
}
}
}
project(':hal').model {
binaries {
withType(SharedLibraryBinarySpec) { spec ->
from(spec.sharedLibraryFile) {
into '/'
}
}
}
}
defineNetworkTablesProperties()
defineWpiUtilProperties()
defineCsCoreProperties()
from (file(netSharedLib)) {
into '/'
}
from (file(wpiUtilSharedLib)) {
into '/'
}
from (file(csLibArmLocation).path) {
include '**/*so.3.1'
include '**/libcscore.so'
include '**/libopencv_java310.so'
into '/'
}
}
build.dependsOn copyRobotLibraries