forked from anyicomplex/gdx-dwt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
136 lines (128 loc) · 6.19 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import org.gradle.internal.jvm.Jvm
allprojects {
def os = System.getProperty("os.name").toLowerCase()
if (project.name.contains('natives')) {
apply plugin: "cpp-library"
library {
linkage = [Linkage.SHARED]
targetMachines = [
machines.windows.x86, machines.windows.x86_64,
machines.linux.x86_64,
machines.macOS.x86_64
]
binaries.configureEach(CppSharedLibrary) {
if (os.contains('win')) {
compileTask.get().compilerArgs.add("-I${Jvm.current().getJavaHome()}/include")
compileTask.get().compilerArgs.add("-I${Jvm.current().getJavaHome()}/include/win32")
linkTask.get().linkerArgs.add("Shlwapi.lib", "Advapi32.lib")
} else if (os.contains('nux')) {
// JVM
compileTask.get().compilerArgs.add("-I${Jvm.current().getJavaHome()}/include")
compileTask.get().compilerArgs.add("-I${Jvm.current().getJavaHome()}/include/linux")
/*
// GTK-3.0
compileTask.get().compilerArgs.add("-I/usr/include/gtk-3.0")
compileTask.get().compilerArgs.add("-I/usr/include/pango-1.0")
compileTask.get().compilerArgs.add("-I/usr/include/glib-2.0")
compileTask.get().compilerArgs.add("-I/usr/lib64/glib-2.0/include")
compileTask.get().compilerArgs.add("-I/usr/include/sysprof-4")
compileTask.get().compilerArgs.add("-I/usr/include/harfbuzz")
compileTask.get().compilerArgs.add("-I/usr/include/freetype2")
compileTask.get().compilerArgs.add("-I/usr/include/libpng16")
compileTask.get().compilerArgs.add("-I/usr/include/libmount")
compileTask.get().compilerArgs.add("-I/usr/include/blkid")
compileTask.get().compilerArgs.add("-I/usr/include/fribidi")
compileTask.get().compilerArgs.add("-I/usr/include/libxml2")
compileTask.get().compilerArgs.add("-I/usr/include/cairo")
compileTask.get().compilerArgs.add("-I/usr/include/pixman-1")
compileTask.get().compilerArgs.add("-I/usr/include/gdk-pixbuf-2.0")
compileTask.get().compilerArgs.add("-I/usr/include/gio-unix-2.0")
compileTask.get().compilerArgs.add("-I/usr/include/cloudproviders")
compileTask.get().compilerArgs.add("-I/usr/include/atk-1.0")
compileTask.get().compilerArgs.add("-I/usr/include/at-spi2-atk/2.0")
compileTask.get().compilerArgs.add("-I/usr/include/dbus-1.0")
compileTask.get().compilerArgs.add("-I/usr/lib64/dbus-1.0/include")
compileTask.get().compilerArgs.add("-I/usr/include/at-spi-2.0")
// pthread
compileTask.get().compilerArgs.add("-pthread")
*/
// 64-bit
compileTask.get().compilerArgs.add('-D_FILE_OFFSET_BITS=64')
// libs
linkTask.get().linkerArgs.add("-lfontconfig")
linkTask.get().linkerArgs.add("-lX11")
/*
linkTask.get().linkerArgs.add("-lgtk-3")
linkTask.get().linkerArgs.add("-lgdk-3")
linkTask.get().linkerArgs.add("-lz")
linkTask.get().linkerArgs.add("-lpangocairo-1.0")
linkTask.get().linkerArgs.add("-lpango-1.0")
linkTask.get().linkerArgs.add("-lharfbuzz")
linkTask.get().linkerArgs.add("-latk-1.0")
linkTask.get().linkerArgs.add("-lcairo-gobject")
linkTask.get().linkerArgs.add("-lcairo")
linkTask.get().linkerArgs.add("-lgdk_pixbuf-2.0")
linkTask.get().linkerArgs.add("-lgio-2.0")
linkTask.get().linkerArgs.add("-lgobject-2.0")
linkTask.get().linkerArgs.add("-lglib-2.0")
*/
} else if (os.contains('mac')) {
compileTask.get().compilerArgs.add("-I${Jvm.current().getJavaHome()}/include")
compileTask.get().compilerArgs.add("-I${Jvm.current().getJavaHome()}/include/darwin")
compileTask.get().compilerArgs.add('-mmacosx-version-min=10.4')
linkTask.get().linkerArgs.add('-mmacosx-version-min=10.4')
}
}
}
}
else {
apply plugin: "java-library"
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
test {
useJUnitPlatform()
}
}
ext {
gdxVersion = '1.10.0'
gdxControllersVersion = '2.2.1'
graalvmVersion = '22.0.0'
//swtVersion='3.111.0'
//osgiPlatform='gtk.linux.x86_64'
}
group 'io.github.anyicomplex'
version gdxVersion
}
dependencies {
implementation "com.badlogicgames.gdx:gdx:$gdxVersion"
}
subprojects {
if (!project.name.contains('natives')) {
dependencies {
implementation project(":")
}
}
}
project(":backends:lwjgl3") {
/*
configurations.all {
resolutionStrategy {
dependencySubstitution {
// The maven property ${osgi.platform} is not handled by Gradle
// so we replace the dependency, using the osgi platform from the project settings
substitute module('org.eclipse.platform:org.eclipse.swt.${osgi.platform}') with module("org.eclipse.platform:org.eclipse.swt.$osgiPlatform:$swtVersion")
}
}
}
*/
dependencies {
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
//implementation "org.eclipse.platform:org.eclipse.swt:$swtVersion"
}
}