Skip to content

Conversation

obiwac
Copy link
Contributor

@obiwac obiwac commented Jan 10, 2025

Currently, when building with Meson, an archive is created containing the archive generated by Cargo (so not directly the object files contained withing the Cargo-generated archive). This causes issues when linking and required an explicit ranlib or ar -s step to be issued before the library is usable:

ld: archive member 'libwgpu_native.a' not a mach-o file in '.../libwgpu_native.a'

It doesn't look like static_library really supports this kind of usecase.

This PR simply installs the static library artifact generated by Cargo directly instead. Unfortunately I don't think there's an elegant way to pass a meson library object to pkg.generate in this situation, so I've just set libraries manually (since it allows arbitrary strings). I'm by no means a Meson expert so do let me know if there's a better way that I'm overlooking :)

@KentaTheBugMaker pinging you as the original author of meson.build (#84) for your input.

@almarklein
Copy link
Collaborator

This looks fine by me, but @KentaTheBugMaker understand this code way better.

@almarklein almarklein merged commit e305465 into gfx-rs:trunk Mar 20, 2025
16 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