arm64 support

master
Mike Desaro 4 years ago
parent 695e59bbf5
commit ae22b69026

@ -1 +1,2 @@
zig-cache zig-cache
zig-arm-cache

@ -2,6 +2,11 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558 // See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format // for the documentation about the tasks.json format
"version": "2.0.0", "version": "2.0.0",
"options": {
"env": {
"ZIG_SYSTEM_LINKER_HACK": "1",
}
},
"tasks": [ "tasks": [
{ {
"label": "Build Project", "label": "Build Project",
@ -26,6 +31,18 @@
"clear": true "clear": true
} }
}, },
{
"label": "Build and Run Project (x64 on arm)",
"type": "shell",
"command": "~/zig/zig-x64/zig build run",
"problemMatcher": [
"$gcc"
],
"group": "build",
"presentation": {
"clear": true
}
},
{ {
"label": "Build and Run Project (release-fast)", "label": "Build and Run Project (release-fast)",
"type": "shell", "type": "shell",

@ -1,9 +1,13 @@
const Builder = @import("std").build.Builder; const std = @import("std");
const Builder = std.build.Builder;
const builtin = @import("builtin"); const builtin = @import("builtin");
pub fn build(b: *Builder) void { pub fn build(b: *Builder) void {
const buildMode = b.standardReleaseOptions(); const buildMode = b.standardReleaseOptions();
// use a different cache folder for macos arm builds
b.cache_root = if (std.builtin.os.tag == .macos and std.builtin.arch == std.builtin.Arch.aarch64) "zig-arm-cache/bin" else "zig-cache/bin";
const examples = [_][2][]const u8{ const examples = [_][2][]const u8{
[_][]const u8{ "view_vs_group", "examples/view_vs_group.zig" }, [_][]const u8{ "view_vs_group", "examples/view_vs_group.zig" },
[_][]const u8{ "group_sort", "examples/group_sort.zig" }, [_][]const u8{ "group_sort", "examples/group_sort.zig" },
@ -25,7 +29,7 @@ pub fn build(b: *Builder) void {
// first element in the list is added as "run" so "zig build run" works // first element in the list is added as "run" so "zig build run" works
if (i == 0) { if (i == 0) {
exe.setOutputDir("zig-cache/bin"); exe.setOutputDir(std.fs.path.joinPosix(b.allocator, &[_][]const u8{ b.cache_root, "bin" }) catch unreachable);
const run_exe_step = b.step("run", b.fmt("run {}.zig", .{name})); const run_exe_step = b.step("run", b.fmt("run {}.zig", .{name}));
run_exe_step.dependOn(&run_cmd.step); run_exe_step.dependOn(&run_cmd.step);
} }

Loading…
Cancel
Save