-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zig: Replace addSharedLibrary with addExecutable
Related to the breaking changes in ziglang/zig#17815
- Loading branch information
1 parent
e39d89d
commit 24b294d
Showing
1 changed file
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |