This repository has been archived by the owner on Jan 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
97 lines (93 loc) · 3.28 KB
/
build.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
apply plugin: 'c'
binaries.all {
if (toolChain in Gcc || toolChain in Clang) {
if (buildType == buildTypes.release) {
cCompiler.define "NDEBUG"
}
cCompiler.define "_REENTRANT"
cCompiler.define "LUA_USE_LINUX"
if (buildType == buildTypes.debug) {
cCompiler.args "-g", "-fno-strict-aliasing"
}
else {
cCompiler.args "-O2", "-fno-strict-aliasing"
linker.args "-s"
}
tasks.withType(LinkSharedLibrary) {
tasks.withType(CCompile) {
includes.from("eris/src")
includes.from("/usr/lib/jvm/java-6-openjdk/include")
includes.from("/usr/lib/jvm/java-6-openjdk/include/linux")
includes.from("/usr/lib/jvm/java-7-openjdk/include")
includes.from("/usr/lib/jvm/java-7-openjdk/include/linux")
includes.from("/usr/lib/jvm/java-7-openjdk-amd64/include")
includes.from("/usr/lib/jvm/java-7-openjdk-amd64/include/linux")
includes.from("/usr/local/openjdk7/include")
includes.from("/usr/local/openjdk7/include/freebsd")
includes.from("/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/include")
includes.from("/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/include/darwin")
}
}
}
if (toolChain in VisualCpp) {
if (buildType == buildTypes.debug) {
cCompiler.args "/Od", "/Zi", "/MTd"
linker.args "/debug"
}
else {
cCompiler.args "/O2", "/MT"
}
tasks.withType(LinkSharedLibrary) {
tasks.withType(CCompile) {
includes.from("eris/src")
includes.from("C:/Program Files (x86)/Java/jdk1.7.0_55/include")
includes.from("C:/Program Files (x86)/Java/jdk1.7.0_55/include/win32")
}
if (targetPlatform == platforms.x86)
libs += files("C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib/uuid.lib", "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib/kernel32.lib")
if (targetPlatform == platforms.x64)
libs += files("C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib/x64/uuid.lib", "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib/x64/kernel32.lib")
}
}
tasks.withType(CCompile) {
positionIndependentCode = true
}
}
libraries {
natives { targetPlatforms "x86", "x64", "arm" }
}
sources {
natives {
c {
source {
srcDir "eris/src"
srcDir "jnlua/jnlua/src/main/c"
include "*.c"
exclude "luac.c", "lua.c"
exclude "javavm.c"
}
}
}
}
model {
buildTypes {
debug
release
}
platforms {
x86 { architecture "x86" }
x64 { architecture "x86_64" }
arm { architecture "arm" }
}
toolChains {
gcc(Gcc) {
linker.executable = 'gcc'
target('arm') {
linker.executable = 'arm-unknown-linux-gnueabi-gcc'
cCompiler.executable = 'arm-unknown-linux-gnueabi-gcc'
}
}
clang(Clang)
visualCpp(VisualCpp)
}
}