forked from scanse/sweep-sdk
-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.gradle
108 lines (96 loc) · 3.28 KB
/
config.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import edu.wpi.first.nativeutils.*
import org.gradle.internal.os.OperatingSystem
def windowsCompilerArgs = ['/EHsc', '/DNOMINMAX', '/Zi', '/FS', '/Zc:inline', '/MT']
def windowsReleaseCompilerArgs = ['/O2']
def windowsLinkerArgs = [ '/DEBUG:FULL' ]
def windowsReleaseLinkerArgs = [ '/OPT:REF', '/OPT:ICF' ]
def linuxCompilerArgs = ['-std=c++11', '-Wformat=2', '-Wall', '-Wextra', '-Werror', '-pedantic', '-Wno-psabi', '-g',
'-Wno-unused-parameter', '-fPIC', '-rdynamic', '-Wno-error=deprecated-declarations', '-pthread']
def linuxLinkerArgs = ['-rdynamic', '-pthread']
def linuxReleaseCompilerArgs = ['-Og']
def linuxDebugCompilerArgs = ['-O0']
def linux32BitArg = '-m32'
def macCompilerArgs = ['-std=c++11', '-Wall', '-Wextra', '-Werror', '-pedantic-errors', '-fPIC', '-g',
'-Wno-unused-parameter', '-Wno-missing-field-initializers', '-Wno-unused-private-field']
def macReleaseCompilerArgs = ['-O2']
def macDebugCompilerArgs = ['-O0']
def mac32BitArg = '-m32'
def buildAll = project.hasProperty('buildAll')
def windows64PlatformDetect = {
def arch = System.getProperty("os.arch")
def isWin = OperatingSystem.current().isWindows()
if (buildAll) {
return isWin
} else {
return isWin && arch == 'amd64'
}
}
def windows32PlatformDetect = {
def arch = System.getProperty("os.arch")
def isWin = OperatingSystem.current().isWindows()
if (buildAll) {
return isWin
} else {
return isWin && arch == 'x86'
}
}
def linux32IntelPlatformDetect = {
def arch = System.getProperty("os.arch")
def isLinux = OperatingSystem.current().isLinux()
def isIntel = (arch == 'amd64' || arch == 'i386')
if (buildAll) {
return isLinux && isIntel
} else {
return isLinux && arch == 'i386'
}
}
def linux64IntelPlatformDetect = {
def arch = System.getProperty("os.arch")
def isLinux = OperatingSystem.current().isLinux()
def isIntel = (arch == 'amd64' || arch == 'i386')
if (buildAll) {
return isLinux && isIntel
} else {
return isLinux && arch == 'amd64'
}
}
def linuxArmPlatformDetect = {
def arch = System.getProperty("os.arch")
def isIntel = (arch == 'amd64' || arch == 'i386')
return OperatingSystem.current().isLinux() && !isIntel
}
def mac64PlatformDetect = {
def arch = System.getProperty("os.arch")
def isMac = OperatingSystem.current().isMacOsX()
if (buildAll) {
return isMac
} else {
return isMac && arch == 'x86_64'
}
}
def mac32PlatformDetect = {
def arch = System.getProperty("os.arch")
def isMac = OperatingSystem.current().isMacOsX()
if (buildAll) {
return isMac
} else {
return isMac && arch == 'x86'
}
}
model {
buildConfigs {
roboRio(CrossBuildConfig) {
architecture = 'athena'
operatingSystem = 'linux'
toolChainPrefix = 'arm-frc-linux-gnueabi-'
compilerArgs = linuxCompilerArgs
linkerArgs = linuxLinkerArgs
debugCompilerArgs = linuxDebugCompilerArgs
releaseCompilerArgs = linuxReleaseCompilerArgs
releaseStripBinaries = true
compilerFamily = 'Gcc'
exclude << 'gmock'
exclude << 'wpiutilTestingBase'
}
}
}