Skip to content

Commit 6fad12d

Browse files
authored
Merge pull request #4927 from lumenkeyes/master
build.zig fixes for android targets
2 parents 3d6e24a + 35de7b2 commit 6fad12d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

build.zig

+9-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
205205
raylib.root_module.addCMacro("PLATFORM_DRM", "");
206206
raylib.root_module.addCMacro("EGL_NO_X11", "");
207207
raylib.root_module.addCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "");
208-
} else if (target.result.abi == .android) {
208+
} else if (target.result.abi.isAndroid()) {
209209

210210
//these are the only tag options per https://developer.android.com/ndk/guides/other_build_systems
211211
const hostTuple = switch (builtin.target.os.tag) {
@@ -215,7 +215,14 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
215215
else => @panic("unsupported host OS"),
216216
};
217217

218-
const androidTriple = try target.result.linuxTriple(b.allocator);
218+
const androidTriple = switch (target.result.cpu.arch) {
219+
.x86 => "i686-linux-android",
220+
.x86_64 => "x86_64-linux-android",
221+
.arm => "arm-linux-androideabi",
222+
.aarch64 => "aarch64-linux-android",
223+
.riscv64 => "riscv64-linux-android",
224+
else => error.InvalidAndroidTarget,
225+
} catch @panic("invalid android target!");
219226
const androidNdkPathString: []const u8 = options.android_ndk;
220227
if (androidNdkPathString.len < 1) @panic("no ndk path provided and ANDROID_NDK_HOME is not set");
221228
const androidApiLevel: []const u8 = options.android_api_version;

0 commit comments

Comments
 (0)