Merge pull request #4927 from lumenkeyes/master
build.zig fixes for android targets
This commit is contained in:
commit
6fad12db73
1 changed files with 9 additions and 2 deletions
11
build.zig
11
build.zig
|
@ -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("PLATFORM_DRM", "");
|
||||||
raylib.root_module.addCMacro("EGL_NO_X11", "");
|
raylib.root_module.addCMacro("EGL_NO_X11", "");
|
||||||
raylib.root_module.addCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "");
|
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
|
//these are the only tag options per https://developer.android.com/ndk/guides/other_build_systems
|
||||||
const hostTuple = switch (builtin.target.os.tag) {
|
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"),
|
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;
|
const androidNdkPathString: []const u8 = options.android_ndk;
|
||||||
if (androidNdkPathString.len < 1) @panic("no ndk path provided and ANDROID_NDK_HOME is not set");
|
if (androidNdkPathString.len < 1) @panic("no ndk path provided and ANDROID_NDK_HOME is not set");
|
||||||
const androidApiLevel: []const u8 = options.android_api_version;
|
const androidApiLevel: []const u8 = options.android_api_version;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue