Przeglądaj źródła

Merge pull request #4927 from lumenkeyes/master

build.zig fixes for android targets
pull/4928/head
Ray 1 miesiąc temu
committed by GitHub
rodzic
commit
6fad12db73
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 9 dodań i 2 usunięć
  1. +9
    -2
      build.zig

+ 9
- 2
build.zig Wyświetl plik

@ -205,7 +205,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
raylib.root_module.addCMacro("PLATFORM_DRM", "");
raylib.root_module.addCMacro("EGL_NO_X11", "");
raylib.root_module.addCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "");
} else if (target.result.abi == .android) {
} else if (target.result.abi.isAndroid()) {
//these are the only tag options per https://developer.android.com/ndk/guides/other_build_systems
const hostTuple = switch (builtin.target.os.tag) {
@ -215,7 +215,14 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
else => @panic("unsupported host OS"),
};
const androidTriple = try target.result.linuxTriple(b.allocator);
const androidTriple = switch (target.result.cpu.arch) {
.x86 => "i686-linux-android",
.x86_64 => "x86_64-linux-android",
.arm => "arm-linux-androideabi",
.aarch64 => "aarch64-linux-android",
.riscv64 => "riscv64-linux-android",
else => error.InvalidAndroidTarget,
} catch @panic("invalid android target!");
const androidNdkPathString: []const u8 = options.android_ndk;
if (androidNdkPathString.len < 1) @panic("no ndk path provided and ANDROID_NDK_HOME is not set");
const androidApiLevel: []const u8 = options.android_api_version;

Ładowanie…
Anuluj
Zapisz