From e4a2e007fcb47ff5ac3df2ca918f21c050e7c465 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 8 Jul 2023 16:55:01 -0700 Subject: [PATCH] build with Zig package manager Signed-off-by: Stephen Gutekanst --- .gitmodules | 12 ++++++++++++ build.zig | 10 +++++----- build.zig.zon | 12 ++++++------ libs/mach-core | 1 + libs/mach-freetype | 1 + libs/mach-gpu | 1 + libs/mach-gpu-dawn | 1 + 7 files changed, 27 insertions(+), 11 deletions(-) create mode 160000 libs/mach-core create mode 160000 libs/mach-freetype create mode 160000 libs/mach-gpu create mode 160000 libs/mach-gpu-dawn diff --git a/.gitmodules b/.gitmodules index 8dd7926e..c1e33e3f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -24,3 +24,15 @@ [submodule "libs/gpu/libs/mach-gpu-dawn"] path = libs/gpu/libs/mach-gpu-dawn url = https://github.com/hexops/mach-gpu-dawn +[submodule "libs/mach-gpu"] + path = libs/mach-gpu + url = https://github.com/hexops/mach-gpu +[submodule "libs/mach-gpu-dawn"] + path = libs/mach-gpu-dawn + url = https://github.com/hexops/mach-gpu-dawn +[submodule "libs/mach-freetype"] + path = libs/mach-freetype + url = https://github.com/hexops/mach-freetype +[submodule "libs/mach-core"] + path = libs/mach-core + url = https://github.com/hexops/mach-core diff --git a/build.zig b/build.zig index 97532c75..bd55abe0 100644 --- a/build.zig +++ b/build.zig @@ -1,13 +1,13 @@ const std = @import("std"); const builtin = @import("builtin"); -const freetype = @import("libs/freetype/build.zig"); +const freetype = @import("libs/mach-freetype/build.zig"); const glfw = @import("mach_glfw"); const sysaudio = @import("mach_sysaudio"); -pub const gpu_dawn = @import("libs/gpu-dawn/build.zig"); // TODO(build-system): make this private -const gpu = @import("libs/gpu/build.zig").Sdk(.{ +pub const gpu_dawn = @import("libs/mach-gpu-dawn/build.zig"); // TODO(build-system): make this private +const gpu = @import("libs/mach-gpu/build.zig").Sdk(.{ .gpu_dawn = gpu_dawn, }); -const core = @import("libs/core/build.zig").Sdk(.{ +const core = @import("libs/mach-core/build.zig").Sdk(.{ .gpu = gpu, .gpu_dawn = gpu_dawn, .glfw = glfw, @@ -34,7 +34,7 @@ pub fn module(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig _module = b.createModule(.{ .source_file = .{ .path = sdkPath("/src/main.zig") }, .dependencies = &.{ - .{ .name = "core", .module = core.module(b) }, + .{ .name = "core", .module = core.module(b, optimize, target) }, .{ .name = "ecs", .module = mach_ecs.module("mach-ecs") }, .{ .name = "earcut", .module = mach_earcut.module("mach-earcut") }, .{ .name = "sysaudio", .module = sysaudio.module(b, optimize, target) }, diff --git a/build.zig.zon b/build.zig.zon index f274d314..8c932d1a 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -27,16 +27,16 @@ .hash = "1220ead8a15f606d6f0f853fe401460dfe18811e3d5d1aa7e808be825e44f17f0dc3", }, .mach_sysaudio = .{ - .url = "https://github.com/hexops/mach-sysaudio/archive/b5bf8a612b5b538b81c17a632ef0dc7d6d9b32ca.tar.gz", - .hash = "1220b52bfeee934e5b4863123fc702cdce84b6c5bec7a00ac1b4ccd91504f006b7f6", + .url = "https://github.com/hexops/mach-sysaudio/archive/583d017ed01540c421ff5004825036b7c982eb7c.tar.gz", + .hash = "12200bef31118c7269e565c7a9fbd6719257182bbe8dd85d18b5b70b007d8e6c7ed3", }, .mach_glfw = .{ - .url = "https://github.com/hexops/mach-glfw/archive/b119c63dd77764eeafe758d54accd0329821a729.tar.gz", - .hash = "1220fb0fb65621a4fc7406e4f74a87a0c60208f8a257cd7ca4e20da0925f875e70d0", + .url = "https://github.com/hexops/mach-glfw/archive/8e78e0175951117213ea65fec32fd61f2e39f4ea.tar.gz", + .hash = "12202c9e56ab6822cf9a16f1b5c15ff17ba17c67c1ec12aa77bc2313dfe9d3c235ec", }, .glfw = .{ - .url = "https://github.com/hexops/glfw/archive/49c21c3d2fcaf9799b593f5320ce8e598a692c74.tar.gz", - .hash = "12200a907165afc4c099d4d19e2f7ce9923a72116006d8f5f5af3a9a071fa66171d2", + .url = "https://github.com/hexops/glfw/archive/0e4cdba4216c6def0423462a2f21fef80683d56d.tar.gz", + .hash = "1220a0b036095c2c54af347c86514ed9dab431299f0140b0e434ed119f85a976c32b", }, .direct3d_headers = .{ .url = "https://github.com/hexops/direct3d-headers/archive/773dce3f079eecdccc7c71d1318a0741649d568b.tar.gz", diff --git a/libs/mach-core b/libs/mach-core new file mode 160000 index 00000000..ed911a7f --- /dev/null +++ b/libs/mach-core @@ -0,0 +1 @@ +Subproject commit ed911a7f83605adb8c31cf1a02a18a7879a260bc diff --git a/libs/mach-freetype b/libs/mach-freetype new file mode 160000 index 00000000..1c9e2d00 --- /dev/null +++ b/libs/mach-freetype @@ -0,0 +1 @@ +Subproject commit 1c9e2d001bce6ea59544c84363e87e38841ea2ea diff --git a/libs/mach-gpu b/libs/mach-gpu new file mode 160000 index 00000000..1266bd93 --- /dev/null +++ b/libs/mach-gpu @@ -0,0 +1 @@ +Subproject commit 1266bd935c20d539d74390380364ec566be4eec9 diff --git a/libs/mach-gpu-dawn b/libs/mach-gpu-dawn new file mode 160000 index 00000000..ad9f4e77 --- /dev/null +++ b/libs/mach-gpu-dawn @@ -0,0 +1 @@ +Subproject commit ad9f4e77a4db6d5e2e635e45db8878eaf7945a88