Skip to content

Commit

Permalink
Merge pull request #669 from peterhellberg/cli/assets/templates/zig-b…
Browse files Browse the repository at this point in the history
…uild-exe

zig: Replace `addSharedLibrary` with `addExecutable`
  • Loading branch information
aduros authored Nov 15, 2023
2 parents b22ce03 + 24b294d commit 091b829
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 091b829

Please sign in to comment.