Skip to content

Commit 929d234

Browse files
committed
Fix build
1 parent 6b3c134 commit 929d234

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

Sdk.zig

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ const auto_detect = @import("build/auto-detect.zig");
1111
pub fn toolchainHostTag() []const u8 {
1212
const os = builtin.os.tag;
1313
const arch = builtin.cpu.arch;
14-
return (comptime if (std.mem.eql(u8, @tagName(os), "macos")) "darwin" else @tagName(os)) ++ "-" ++ @tagName(arch);
14+
if (std.mem.eql(u8, @tagName(os), "macos")) {
15+
// NOTE: There is no darwin-aarch64 toolchain for Android currently
16+
return "darwin-x86_64";
17+
} else {
18+
return @tagName(os) ++ "-" ++ @tagName(arch);
19+
}
1520
}
1621

1722
/// This file encodes a instance of an Android SDK interface.
@@ -108,8 +113,8 @@ pub fn init(b: *Build, user_config: ?UserConfig, toolchains: ToolchainVersions)
108113
}
109114

110115
pub const ToolchainVersions = struct {
111-
build_tools_version: []const u8 = "33.0.1",
112-
ndk_version: []const u8 = "25.1.8937393",
116+
build_tools_version: []const u8 = "34.0.0",
117+
ndk_version: []const u8 = "27.2.12479018",
113118
};
114119

115120
pub const AndroidVersion = enum(u16) {
@@ -179,8 +184,7 @@ pub const AppConfig = struct {
179184
package_name: []const u8,
180185

181186
/// The android version which is embedded in the manifset.
182-
/// The default is Android 9, it's more than 4 years old by now and should be widespread enough to be a reasonable default.
183-
target_version: AndroidVersion = .android9,
187+
target_version: AndroidVersion = .android13,
184188

185189
/// The resource directory that will contain the manifest and other app resources.
186190
/// This should be a distinct directory per app.
@@ -466,7 +470,7 @@ pub fn createApp(
466470
\\android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
467471
else
468472
\\
469-
;
473+
;
470474

471475
writer.print(
472476
\\ <application android:debuggable="true" android:hasCode="{[hasCode]}" android:label="@string/app_name" {[theme]s} tools:replace="android:icon,android:theme,android:allowBackup,label" android:icon="@mipmap/icon" >
@@ -877,7 +881,7 @@ pub fn compileAppLibrary(
877881
exe.bundle_compiler_rt = true;
878882
exe.export_table = true;
879883

880-
exe.defineCMacro("ANDROID", null);
884+
exe.root_module.addCMacro("ANDROID", "");
881885

882886
exe.linkLibC();
883887
for (app_config.libraries) |lib| {

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub fn build(b: *std.Build) !void {
99
// Default-initialize SDK
1010
const sdk = Sdk.init(b, null, .{});
1111
const mode = b.standardOptimizeOption(.{});
12-
const android_version = b.option(Sdk.AndroidVersion, "android", "Select the android version, default is 'android5'") orelse .android5;
12+
const android_version = b.option(Sdk.AndroidVersion, "android", "Select the android version, default is 'android13'") orelse .android13;
1313
const aaudio = b.option(bool, "aaudio", "Compile with support for AAudio, default is 'false'") orelse false;
1414
const opensl = b.option(bool, "opensl", "Compile with support for OpenSL ES, default is 'true'") orelse true;
1515

0 commit comments

Comments
 (0)