Files
allwpilib/hal/build.gradle

93 lines
2.5 KiB
Groovy
Raw Normal View History

2018-04-29 13:29:07 -07:00
ext {
addHalDependency = { binary, shared->
binary.lib project: ':hal', library: 'hal', linkage: shared
}
addHalJniDependency = { binary->
binary.lib project: ':hal', library: 'halJNIShared', linkage: 'shared'
}
2018-04-29 13:29:07 -07:00
nativeName = 'hal'
setBaseName = 'wpiHal'
devMain = 'edu.wpi.first.hal.DevMain'
2018-04-29 13:29:07 -07:00
niLibraries = true
generatedHeaders = "src/generated/main/native/include"
2018-04-29 13:29:07 -07:00
splitSetup = {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
2018-04-29 13:29:07 -07:00
it.sources {
athenaCpp(CppSourceSet) {
source {
srcDirs = ['src/main/native/athena']
2018-04-29 13:29:07 -07:00
include '**/*.cpp'
}
exportedHeaders {
srcDir 'src/main/native/include'
srcDir generatedHeaders
2018-04-29 13:29:07 -07:00
}
}
}
} else {
it.sources {
simCpp(CppSourceSet) {
source {
srcDirs 'src/main/native/sim'
include '**/*.cpp'
}
exportedHeaders {
srcDir 'src/main/native/include'
srcDir generatedHeaders
2018-04-29 13:29:07 -07:00
}
}
}
}
}
2022-10-02 06:13:08 -07:00
exeSplitSetup = {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
2018-04-29 13:29:07 -07:00
}
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
sourceSets.main.java.srcDir "${projectDir}/src/generated/main/java"
2018-04-29 13:29:07 -07:00
cppSourcesZip {
from('src/main/native/athena') {
into '/athena'
}
from('src/main/native/sim') {
into '/sim'
}
}
cppHeadersZip {
from(generatedHeaders) {
into '/'
}
}
Action<List<String>> symbolFilter = { symbols ->
symbols.removeIf({ !it.startsWith('HAL_') && !it.startsWith('HALSIM_') })
} as Action<List<String>>;
nativeUtils.exportsConfigs {
hal {
}
halJNI {
x64SymbolFilter = symbolFilter
}
}
2019-11-13 21:35:52 -08:00
model {
binaries {
all {
if (!(it instanceof NativeBinarySpec)) return
if (it.component.name != 'hal' && it.component.name != 'halBase') return
if (it.targetPlatform.name != nativeUtils.wpi.platforms.roborio) return
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries')
2019-11-13 21:35:52 -08:00
}
}
}