Skip to content

Add --js-library support - #16

Merged
hazeycode merged 2 commits into
zig-gamedev:mainfrom
jburgy:add-js-library-support
Nov 12, 2025
Merged

Add --js-library support#16
hazeycode merged 2 commits into
zig-gamedev:mainfrom
jburgy:add-js-library-support

Conversation

@jburgy

@jburgy jburgy commented Nov 8, 2025

Copy link
Copy Markdown
Contributor

jburgy added a commit to zig-wasm/zorth that referenced this pull request Nov 8, 2025
jburgy added a commit to zig-wasm/zorth that referenced this pull request Nov 9, 2025
* Don't Repeat Yourself

* Hack around zig-gamedev/zemscripten#16
@hazeycode
hazeycode requested a review from Copilot November 11, 2025 11:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the --js-library flag to the Emscripten build system integration, allowing users to specify custom JavaScript library files. The PR also includes code style improvements and refactoring.

  • Added js_library_path parameter to StepOptions for specifying JavaScript library files
  • Simplified optional value handling using the orelse operator
  • Added necessary type casts for Emscripten allocator functions

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
build.zig Added js_library_path field to StepOptions and implemented --js-library flag support; removed unused shell_file field from EmccDefaultSettingsOverrides; refactored output file name handling
src/zemscripten.zig Simplified optional value handling with orelse operator; added @intCast for usize to u32 conversions in allocator functions; modified type casting in alignment calculation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/zemscripten.zig Outdated
@jburgy

jburgy commented Nov 12, 2025

Copy link
Copy Markdown
Contributor Author

Turns out this simple fix turned up a (very trivial) bug in the Zig standard library: ziglang/zig#25899!

@hazeycode hazeycode left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hazeycode
hazeycode merged commit f724af6 into zig-gamedev:main Nov 12, 2025
3 checks passed
@jburgy
jburgy deleted the add-js-library-support branch November 12, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants