floooh / sokol-zig

Zig bindings for the sokol headers (https://github.com/floooh/sokol)
zlib License
341 stars 46 forks source link

Use linkSystemLibraryName on Windows #32

Closed michaelbartnett closed 1 year ago

michaelbartnett commented 1 year ago

Latest nightly Zig tries to run pkg-config and fails to build sokol-zig on Windows if you use linkSystemLibrary. Switching to linkSystemLibraryName does the right thing for now. I also tested with 0.10.0.

Not sure if this was intentional, but when I ran a pre-0.10.0 zig build under ProcMon for a bit looking at other issues I noticed it was just constantly invoking pkg-config, failing, and falling back to linking by name anyway. So I'm not sure if the "proper" way to link kernel32, etc. has been settled. 🤷

floooh commented 1 year ago

Hmm weird, I wasn't aware that there's a separate linkSystemLibraryName() function, the std library doc says one should use linkSystemLibrary() instead. I wonder if this is a remporary regression.

I'll merge the PR regardless, many thanks!

(PS: forgot link to std doc: https://ziglang.org/documentation/master/std/#root;build.LibExeObjStep.linkSystemLibraryName)