Fix LWJGL native load error
This commit is contained in:
parent
cdde093b31
commit
f4019455cc
1 changed files with 23 additions and 20 deletions
|
@ -26,6 +26,29 @@ plugins {
|
|||
id("maven-publish")
|
||||
}
|
||||
|
||||
// Determine operating system and architecture
|
||||
switch (OperatingSystem.current()) {
|
||||
case OperatingSystem.LINUX:
|
||||
project.dependencyLwjglNatives = "natives-linux"
|
||||
def osArch = System.getProperty("os.arch")
|
||||
if (osArch.startsWith("arm") || osArch.startsWith("aarch64"))
|
||||
project.dependencyLwjglNatives += osArch.contains("64") || osArch.startsWith("armv8") ? "-arm64" : "-arm32"
|
||||
else if (osArch.startsWith("ppc"))
|
||||
project.dependencyLwjglNatives += "-ppc64le"
|
||||
else if (osArch.startsWith("riscv"))
|
||||
project.dependencyLwjglNatives += "-riscv64"
|
||||
break
|
||||
case OperatingSystem.MAC_OS:
|
||||
project.dependencyLwjglNatives = System.getProperty("os.arch").startsWith("aarch64") ? "natives-macos-arm64" : "natives-macos"
|
||||
break
|
||||
case OperatingSystem.WINDOWS:
|
||||
def osArch = System.getProperty("os.arch")
|
||||
project.dependencyLwjglNatives = osArch.contains("64")
|
||||
? "natives-windows${osArch.startsWith("aarch64") ? "-arm64" : ""}"
|
||||
: "natives-windows-x86"
|
||||
break
|
||||
}
|
||||
|
||||
// Dependencies
|
||||
dependencies {
|
||||
// Lombok
|
||||
|
@ -125,26 +148,6 @@ publishing {
|
|||
}
|
||||
}
|
||||
|
||||
// Determine operating system and architecture
|
||||
switch (OperatingSystem.current()) {
|
||||
case OperatingSystem.LINUX:
|
||||
project.dependencyLwjglNatives = "natives-linux"
|
||||
def osArch = System.getProperty("os.arch")
|
||||
if (osArch.startsWith("arm") || osArch.startsWith("aarch64"))
|
||||
project.dependencyLwjglNatives += osArch.contains("64") || osArch.startsWith("armv8") ? "-arm64" : "-arm32"
|
||||
else if (osArch.startsWith("ppc"))
|
||||
project.dependencyLwjglNatives += "-ppc64le"
|
||||
else if (osArch.startsWith("riscv"))
|
||||
project.dependencyLwjglNatives += "-riscv64"
|
||||
case OperatingSystem.MAC_OS:
|
||||
project.dependencyLwjglNatives = System.getProperty("os.arch").startsWith("aarch64") ? "natives-macos-arm64" : "natives-macos"
|
||||
case OperatingSystem.WINDOWS:
|
||||
def osArch = System.getProperty("os.arch")
|
||||
project.dependencyLwjglNatives = osArch.contains("64")
|
||||
? "natives-windows${osArch.startsWith("aarch64") ? "-arm64" : ""}"
|
||||
: "natives-windows-x86"
|
||||
}
|
||||
|
||||
// Fix delombok task
|
||||
delombok.doFirst {
|
||||
File target = file("${project.projectDir}/src/main/module-info.java")
|
||||
|
|
Loading…
Reference in a new issue