Merge pull request #51 from A-nony-mous/fix/windows-build

Fix the Android build on Windows
This commit is contained in:
James Babcock authored and GitHub committed 2026-10-23 14:30:33 -07:00
commit bce2307fdb
4 files changed
+23 -5

No files matched your search

+11 -2
View File
@@ -111,7 +111,12 @@ tasks.register("prepareFaceclawNativeLibs") {
if (ndkRoot == null || !ndkRoot.exists()) {
throw new GradleException("Android NDK is required to build libfaceclaw_lc3.so")
}
def clang = file("$ndkRoot/toolchains/llvm/prebuilt/${faceclawNdkHostTag()}/bin/aarch64-linux-android24-clang")
// The NDK ships the clang driver twice: extensionless (a Unix shell script)
// and as .cmd (the CreateProcess-launchable one Windows needs).
def clangBin = "$ndkRoot/toolchains/llvm/prebuilt/${faceclawNdkHostTag()}/bin/aarch64-linux-android24-clang"
def clang = Os.isFamily(Os.FAMILY_WINDOWS)
? file("${clangBin}.cmd")
: file(clangBin)
if (!clang.exists()) {
throw new GradleException("Could not find Android clang at $clang")
}
@@ -229,7 +234,11 @@ tasks.register("prepareFaceclawLlama") {
// strip it so the APK only pays for the code (~8MB).
def ndkRootForStrip = faceclawFindNdkRoot()
if (ndkRootForStrip != null) {
def llvmStrip = file("$ndkRootForStrip/toolchains/llvm/prebuilt/${faceclawNdkHostTag()}/bin/llvm-strip")
// Windows wants llvm-strip.exe; the extensionless file is a Unix script.
def llvmStripBin = "$ndkRootForStrip/toolchains/llvm/prebuilt/${faceclawNdkHostTag()}/bin/llvm-strip"
def llvmStrip = Os.isFamily(Os.FAMILY_WINDOWS) && file("${llvmStripBin}.exe").exists()
? file("${llvmStripBin}.exe")
: file(llvmStripBin)
if (llvmStrip.exists()) {
exec {
commandLine([llvmStrip.absolutePath, "--strip-unneeded", llamaSo.absolutePath])