gdesmott / system-deps

Run pkg-config from declarative dependencies in Cargo.toml
Apache License 2.0
87 stars 21 forks source link

Support passing pkg-config a triple-specific env variables #62

Open lu-zero opened 2 years ago

lu-zero commented 2 years ago

It should mimic cargo use of triples for the compiler env.

sdroege commented 2 years ago

Do you have some examples how this would be used in practice?

lu-zero commented 2 years ago

in rav1e we tripped in a situation in which an user sets PKG_CONFIG_PATH to a cross-build path and somehow it trips since our build.rs that requires to link host stuff.

In would be good to have a mean to have different search paths per target to avoid the or even just have a HOST/TARGET split.

nirbheek commented 2 years ago

Ideally you would invoke pkg-config yourself with the right env vars, instead of having pkg-config understand build / host etc. This also allows you to extend the same to other dependency search tools like cmake and qmake. This is exactly what meson does: --build.pkg-config-path --build.cmake-prefix-path vs --pkg-config-path --cmake-prefix-path.

gdesmott commented 1 year ago

even just have a HOST/TARGET split.

Looks like pkg-config-rs, used by system-deps already support HOST/TARGET env variables. Would this do or what are you looking for exactly?

lu-zero commented 1 year ago

Probably it does, I opened the issue to forward the concern a rav1e user had.