Skip to content

Allow defining zopengl export-linkage at build time - #33

Merged
hazeycode merged 2 commits into
zig-gamedev:mainfrom
pascalPost:main
Feb 12, 2026
Merged

Allow defining zopengl export-linkage at build time#33
hazeycode merged 2 commits into
zig-gamedev:mainfrom
pascalPost:main

Conversation

@pascalPost

Copy link
Copy Markdown
Contributor

This change allows zopengl export-linkage to be selected at build time:

  • internal for Emscripten builds
  • strong for desktop builds

Using strong linkage with Emscripten can break builds due to symbol collisions with Emscripten-exported symbols, so Emscripten now uses internal linkage by default.

Example usage (build.zig):

const zopengl_export_linkage: std.builtin.GlobalLinkage =
    if (target.result.os.tag == .emscripten) .internal else .strong;

const zopengl =
    b.dependency("zopengl", .{
        .target = target,
        .export_linkage = zopengl_export_linkage,
    });

@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 db9d615 into zig-gamedev:main Feb 12, 2026
3 checks passed
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.

2 participants