mirror of
https://github.com/ziglang/zig.git
synced 2025-12-25 23:53:15 +00:00
Currently transitive system library dependencies are always linked using linkSystemLibrary() and therefore pkg-config even if they were originally specified with linkSystemLibraryName() instead. This causes problems in practice for projects needing total control over exactly what library is linked, such as the mach game engine. This is fixed by keeping track of whether libraries are to be linked with pkg-config or not and holding off on actually running pkg-config until after transitive dependency resolution in LibExeObjStep.make(). This also fixes a separate issue with the pkg-config handling that could cause partial application of pkg-config flags if the first part of the pkg-config output parses correctly but there is an error later on. This error isn't always fatal as we fall back to a plain -lfoo in the case of linkSystemLibrary().