Static Libraries Not Propagating System Include/Library Paths to Consuming Executables

This issue I just created does a good job of describing what I ran into:

But, the TLDR:

  • Create a static library in build.zig, link in some “system” library using:
    static_lib.addSystemIncludePath(.{ .cwd_relative = "/some/system/path/some_lib_folder/include" });
    static_lib.addLibraryPath(.{ .cwd_relative = "/some/system/path/some_lib_folder/lib" });
  • Link against this library in your application like so:
  • Observe that you get an error from Zig looking like:
error: error: unable to find dynamic system library 'some_lib' using strategy 'paths_first'. searched paths:
  • Observe that the path you provided to your static library in static_lib.addLibraryPath(() is nowhere to be found…

This can’t be intended behavior, right? Shouldn’t the static library propagate its library/system include paths up to an executable that’s linking against it?