SPM: brew-packaged library: where do include/lib paths come from?

I am trying to use a brew-packaged system library (it has no pkg-config, in case that matters), but nothing seems to be connecting the homebrew installation prefix to its dependents. That is, I can use it by putting an absolute path to its installed header in the module map ( umbrella header "/opt/homebrew/include/marpa.h", and by adding an unsafe linker flag to any dependent targets ( (linkerSettings: [.unsafeFlags(["-L/opt/homebrew/lib"])] ) but surely that’s no way to construct a package that will work on other machines. What am I missing?

1 Like

Another update. This is kooky: I added a local shim.h containing #include "marpa.h" and listed shim.h as my umbrella header instead of referring to "marpa.h" directly in my module.modulemap. All problems seem to be solved. The need for linkerSettings is tied to the lack of a pkgconfig/libmarpa.pc file. I added one and that went away.