From 24b294d4b8cf5f0a9e8c6a3f9bc9b51d8a0394d1 Mon Sep 17 00:00:00 2001 From: Peter Hellberg Date: Tue, 7 Nov 2023 11:14:24 +0100 Subject: [PATCH] zig: Replace addSharedLibrary with addExecutable Related to the breaking changes in https://github.com/ziglang/zig/pull/17815 --- cli/assets/templates/zig/build.zig | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cli/assets/templates/zig/build.zig b/cli/assets/templates/zig/build.zig index 81189f42..513c218b 100644 --- a/cli/assets/templates/zig/build.zig +++ b/cli/assets/templates/zig/build.zig @@ -1,22 +1,22 @@ const std = @import("std"); pub fn build(b: *std.Build) !void { - const optimize = b.standardOptimizeOption(.{}); - - const lib = b.addSharedLibrary(.{ + const exe = b.addExecutable(.{ .name = "cart", .root_source_file = .{ .path = "src/main.zig" }, - .target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding }, - .optimize = optimize, + .target = .{ + .cpu_arch = .wasm32, + .os_tag = .freestanding, + }, + .optimize = b.standardOptimizeOption(.{}), }); - lib.import_memory = true; - lib.initial_memory = 65536; - lib.max_memory = 65536; - lib.stack_size = 14752; - - // Export WASM-4 symbols - lib.export_symbol_names = &[_][]const u8{ "start", "update" }; + exe.entry = .disabled; + exe.export_symbol_names = &[_][]const u8{ "start", "update" }; + exe.import_memory = true; + exe.initial_memory = 65536; + exe.max_memory = 65536; + exe.stack_size = 14752; - b.installArtifact(lib); + b.installArtifact(exe); }