-
Notifications
You must be signed in to change notification settings - Fork 7
Update EMSDK and add Emmaloc #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
d39fc66
5236a10
aa99455
cbcddef
54de61c
bc2ce6f
ab50362
58c0078
d05e572
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,12 @@ const std = @import("std"); | |
|
||
pub const emsdk_ver_major = "3"; | ||
pub const emsdk_ver_minor = "1"; | ||
pub const emsdk_ver_tiny = "52"; | ||
pub const emsdk_ver_tiny = "73"; | ||
pub const emsdk_version = emsdk_ver_major ++ "." ++ emsdk_ver_minor ++ "." ++ emsdk_ver_tiny; | ||
|
||
pub fn build(b: *std.Build) void { | ||
_ = b.addModule("root", .{ .root_source_file = b.path("src/zemscripten.zig") }); | ||
_ = b.addModule("dummy", .{ .root_source_file = b.path("src/dummy.zig") }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is dummy.zig for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you run natively, @import("zemscripten") imports the dummy.zig instead of zemscripten.zig, so you can run both natively and emscripten in the same program. There might be a better way to do this. We could make it so that importing zemscripten means only a emscripten build could run. I forgot to add to the README, when you build like this it would look like
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Multiple main files is the strategy I use in personal projects. I also intend to refactor the zig-gamedev samples to be like sdl2_demo (https://github.com/zig-gamedev/zig-gamedev/tree/main/samples/sdl2_demo/src). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, yeah I do the same thing. So safe to remove dummy.zig? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I think so. We could put it back if it is useful to someone later. |
||
} | ||
|
||
pub fn emccPath(b: *std.Build) []const u8 { | ||
|
@@ -32,6 +33,13 @@ pub fn emrunPath(b: *std.Build) []const u8 { | |
}) catch unreachable; | ||
} | ||
|
||
pub fn htmlPath(b: *std.Build) []const u8 { | ||
return std.fs.path.join(b.allocator, &.{ | ||
b.dependency("emsdk", .{}).path("").getPath(b), | ||
"upstream/emscripten/src/shell.html", | ||
}) catch unreachable; | ||
} | ||
|
||
pub fn activateEmsdkStep(b: *std.Build) *std.Build.Step { | ||
const emsdk_script_path = std.fs.path.join(b.allocator, &.{ | ||
b.dependency("emsdk", .{}).path("").getPath(b), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub const is_emscripten = false; | ||
hazeycode marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.