Skip to content

Commit

Permalink
zig: Replace addSharedLibrary with addExecutable
Browse files Browse the repository at this point in the history
Related to the breaking changes in ziglang/zig#17815
  • Loading branch information
peterhellberg committed Nov 7, 2023
1 parent e39d89d commit 24b294d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cli/assets/templates/zig/build.zig
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 24b294d

Please sign in to comment.