forked from scanse/sweep-sdk
-
Notifications
You must be signed in to change notification settings - Fork 3
/
driver.gradle
54 lines (45 loc) · 1.72 KB
/
driver.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
defineWpiUtilProperties()
defineHALProperties()
def driverSetupModel = { project ->
project.model {
components {
sweepDriver(NativeLibrarySpec) {
targetPlatform 'arm'
setupDefines(project, binaries)
binaries.all {
tasks.withType(CppCompile) {
cppCompiler.args "-DNAMESPACED_WPILIB"
addWpiUtilLibraryLinks(it, linker, targetPlatform)
addHalLibraryLinks(it, linker, targetPlatform)
}
}
project.setupJniIncludes(binaries)
project.checkNativeSymbols(project.getNativeJNISymbols)
sources {
cpp {
source {
srcDirs = [driverSrc, javaJNISrc, driverLibrarySrc]
includes = ["**/*.cpp", "*.c"]
excludes = ['dummy.c']
}
exportedHeaders {
srcDirs = [driverInclude, driverLibraryInclude, halInclude, wpiUtilInclude]
project.jniHeaders.outputs.files.each { file ->
srcDirs file.getPath()
}
includes = ['**/*.h']
excludes = ['protocol.h', 'serial.h', 'sweep_time.h']
}
}
}
}
}
}
}
project(':arm:driver') {
apply plugin: 'cpp'
apply from: "${rootDir}/toolchains/arm.gradle"
apply from: "${rootDir}/java/java.gradle"
driverSetupModel(project)
project.debugStripSetup()
}