Skip to content

Commit

Permalink
fix app compilation for arm macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubvf committed Apr 18, 2024
1 parent 49417c1 commit 5305618
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/macos/BuildMacos.zig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ pub fn create(owner: *std.Build, options: Options) *BuildMacos {
});
object.bundle_compiler_rt = true;

const compile_target = owner.fmt("{s}-apple-macosx{}", .{
if (options.target.result.cpu.arch == .aarch64) "arm64" else @tagName(options.target.result.cpu.arch),
options.target.result.os.version_range.semver.min,
});

const swiftc = owner.addSystemCommand(&.{
"swiftc",
if (options.optimize == .Debug) "-Onone" else "-O",
Expand All @@ -37,7 +42,7 @@ pub fn create(owner: *std.Build, options: Options) *BuildMacos {
"-lc++",
"-lsqlite3",
"-target",
owner.fmt("{s}-apple-macosx{}", .{ @tagName(options.target.result.cpu.arch), options.target.result.os.version_range.semver.min }),
compile_target,
"-o",
});

Expand Down

0 comments on commit 5305618

Please sign in to comment.