@@ -9,11 +9,52 @@ repositories {
9
9
mavenCentral()
10
10
}
11
11
12
+ val lwjglVersion = " 3.3.3"
13
+
14
+ val lwjglNatives = Pair (
15
+ System .getProperty(" os.name" )!! ,
16
+ System .getProperty(" os.arch" )!!
17
+ ).let { (name, arch) ->
18
+ when {
19
+ arrayOf(" Linux" , " SunOS" , " Unit" ).any { name.startsWith(it) } ->
20
+ if (arrayOf(" arm" , " aarch64" ).any { arch.startsWith(it) })
21
+ " natives-linux${if (arch.contains(" 64" ) || arch.startsWith(" armv8" )) " -arm64" else " -arm32" } "
22
+ else if (arch.startsWith(" ppc" ))
23
+ " natives-linux-ppc64le"
24
+ else if (arch.startsWith(" riscv" ))
25
+ " natives-linux-riscv64"
26
+ else
27
+ " natives-linux"
28
+ arrayOf(" Mac OS X" , " Darwin" ).any { name.startsWith(it) } ->
29
+ " natives-macos${if (arch.startsWith(" aarch64" )) " -arm64" else " " } "
30
+ arrayOf(" Windows" ).any { name.startsWith(it) } ->
31
+ if (arch.contains(" 64" ))
32
+ " natives-windows${if (arch.startsWith(" aarch64" )) " -arm64" else " " } "
33
+ else
34
+ " natives-windows-x86"
35
+ else ->
36
+ throw Error (" Unrecognized or unsupported platform. Please set \" lwjglNatives\" manually" )
37
+ }
38
+ }
39
+
12
40
dependencies {
13
41
implementation(" org.jetbrains.kotlin:kotlin-reflect" )
14
42
implementation(" org.slf4j:slf4j-simple:2.0.12" )
15
43
16
44
testImplementation(" org.jetbrains.kotlin:kotlin-test" )
45
+
46
+ testImplementation(platform(" org.lwjgl:lwjgl-bom:$lwjglVersion " ))
47
+
48
+ testImplementation(" org.lwjgl" , " lwjgl" )
49
+ testImplementation(" org.lwjgl" , " lwjgl-glfw" )
50
+ testImplementation(" org.lwjgl" , " lwjgl-nanovg" )
51
+ testImplementation(" org.lwjgl" , " lwjgl-opengl" )
52
+ testImplementation(" org.lwjgl" , " lwjgl-stb" )
53
+ testRuntimeOnly(" org.lwjgl" , " lwjgl" , classifier = lwjglNatives)
54
+ testRuntimeOnly(" org.lwjgl" , " lwjgl-glfw" , classifier = lwjglNatives)
55
+ testRuntimeOnly(" org.lwjgl" , " lwjgl-nanovg" , classifier = lwjglNatives)
56
+ testRuntimeOnly(" org.lwjgl" , " lwjgl-opengl" , classifier = lwjglNatives)
57
+ testRuntimeOnly(" org.lwjgl" , " lwjgl-stb" , classifier = lwjglNatives)
17
58
}
18
59
19
60
tasks.test {
0 commit comments