Skip to content

Commit

Permalink
Update to latest Zig master
Browse files Browse the repository at this point in the history
  • Loading branch information
tau-dev committed Jun 25, 2023
1 parent bc386f1 commit 6f45912
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 86 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*This is the source code of [my WASM4 jam entry](https://tau-dev.itch.io/taufl1) from some time ago. It's a neat little software renderer, but the code is very unoptimized and has lots of game-jam sloppiness.*

# Tᴀᴜ Flight Simulator 1.0

A flight sim game for the [WASM-4](https://wasm4.org) fantasy console.
Expand Down
12 changes: 7 additions & 5 deletions build.zig
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const std = @import("std");

pub fn build(b: *std.build.Builder) !void {
const mode = b.standardReleaseOptions();
const lib = b.addSharedLibrary("taufl1", "src/main.zig", .unversioned);
const lib = b.addSharedLibrary(.{
.name = "taufl1",
.root_source_file = .{ .path = "src/main.zig" },
.optimize = .ReleaseSmall,
.target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
});

lib.setBuildMode(mode);
lib.setTarget(.{ .cpu_arch = .wasm32, .os_tag = .freestanding });
lib.import_memory = true;
lib.initial_memory = 65536;
lib.max_memory = 65536;
Expand All @@ -14,7 +16,7 @@ pub fn build(b: *std.build.Builder) !void {
// Export WASM-4 symbols
lib.export_symbol_names = &[_][]const u8{ "start", "update" };

lib.install();
b.installArtifact(lib);

const dest = b.pathJoin(&.{ b.install_path, "lib", lib.out_filename });
const compress = b.addSystemCommand(&.{"wasm-opt", "-Os", dest, "-o", dest});
Expand Down
Loading

0 comments on commit 6f45912

Please sign in to comment.