Skip to content

Commit 987c3dc

Browse files
committed
feat: add ppc64le
1 parent c34d4ea commit 987c3dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/kotlin/dev/silenium/libs/jni/NativePlatform.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ data class Platform(val os: OS, val arch: Arch, val extension: String? = null) :
1212
}
1313

1414
enum class Arch {
15-
X86, X86_64, ARM, ARM64;
15+
X86, X86_64, ARM, ARM64, PPC64LE;
1616

1717
override fun toString() = name.lowercase()
1818
}
@@ -67,6 +67,7 @@ class NativePlatform(osString: String, archString: String) : INativePlatform {
6767
isX86() -> Platform.Arch.X86
6868
isArm64() -> Platform.Arch.ARM64
6969
isArm() -> Platform.Arch.ARM
70+
isPPC64LE() -> Platform.Arch.PPC64LE
7071

7172
else -> throw UnsupportedOperationException("Unsupported architecture: $archString")
7273
}
@@ -92,5 +93,8 @@ class NativePlatform(osString: String, archString: String) : INativePlatform {
9293
it.isX86 && it.is64Bit
9394
} == true
9495

96+
private fun isPPC64LE(): Boolean = ArchUtils.getProcessor(archString)
97+
?.let { it.isPPC && it.is64Bit } == true || archString.contains("ppc64le")
98+
9599
companion object : INativePlatform by NativePlatform(System.getProperty("os.name"), System.getProperty("os.arch"))
96100
}

0 commit comments

Comments
 (0)