diff --git a/gdx-jnigen-loader/src/main/java/com/badlogic/gdx/utils/Architecture.java b/gdx-jnigen-loader/src/main/java/com/badlogic/gdx/utils/Architecture.java index cbe3a1e2..0a315bfc 100644 --- a/gdx-jnigen-loader/src/main/java/com/badlogic/gdx/utils/Architecture.java +++ b/gdx-jnigen-loader/src/main/java/com/badlogic/gdx/utils/Architecture.java @@ -1,7 +1,7 @@ package com.badlogic.gdx.utils; public enum Architecture { - x86, ARM, RISCV; + x86, ARM, RISCV,LOONGARCH; public String toSuffix() { if (this == x86) return ""; diff --git a/gdx-jnigen-loader/src/main/java/com/badlogic/gdx/utils/SharedLibraryLoader.java b/gdx-jnigen-loader/src/main/java/com/badlogic/gdx/utils/SharedLibraryLoader.java index b05a978f..24a04b32 100644 --- a/gdx-jnigen-loader/src/main/java/com/badlogic/gdx/utils/SharedLibraryLoader.java +++ b/gdx-jnigen-loader/src/main/java/com/badlogic/gdx/utils/SharedLibraryLoader.java @@ -53,6 +53,8 @@ else if (System.getProperty("os.name").contains("Mac")) architecture = Architecture.ARM; else if (System.getProperty("os.arch").startsWith("riscv")) architecture = Architecture.RISCV; + else if (System.getProperty("os.arch").startsWith("loongarch")) + architecture = Architecture.LOONGARCH; if (System.getProperty("os.arch").contains("64") || System.getProperty("os.arch").startsWith("armv8")) bitness = Architecture.Bitness._64; diff --git a/gdx-jnigen/src/main/java/com/badlogic/gdx/jnigen/BuildTarget.java b/gdx-jnigen/src/main/java/com/badlogic/gdx/jnigen/BuildTarget.java index 2c3efe41..af49ccce 100644 --- a/gdx-jnigen/src/main/java/com/badlogic/gdx/jnigen/BuildTarget.java +++ b/gdx-jnigen/src/main/java/com/badlogic/gdx/jnigen/BuildTarget.java @@ -177,6 +177,15 @@ public static BuildTarget newDefaultTarget (Os type, Architecture.Bitness bitnes "-Wl,--kill-at -shared -static -static-libgcc -static-libstdc++ -m64"); } + if (type == Os.Linux && architecture == Architecture.LOONGARCH && bitness == Architecture.Bitness._64) { + // Linux LoongArch 64-Bit + BuildTarget target = new BuildTarget(Os.Linux, Architecture.Bitness._64, new String[] {"**/*.c"}, new String[0], new String[] {"**/*.cpp"}, + new String[0], new String[0], "loongarch64-unknown-linux-gnu-", "-c -Wall -O2 -fmessage-length=0 -fPIC", + "-c -Wall -O2 -fmessage-length=0 -fPIC", "-shared"); + target.architecture = Architecture.LOONGARCH; + return target; + } + if (type == Os.Linux && architecture == Architecture.RISCV && bitness == Architecture.Bitness._32) { // Linux RISCV 32-Bit BuildTarget target = new BuildTarget(Os.Linux, Architecture.Bitness._32, new String[] {"**/*.c"}, new String[0], new String[] {"**/*.cpp"},