Expanding on an earlier question about overriding build scripts with custom libraries...
I have multiple build targets, and might have more in the future:
.cargo/config
:
[target.x86_64-unknown-linux-gnu.libfoo]
rustc-link-lib = ["libfoo"]
[target.x86_64-apple-darwin.libfoo]
rustc-link-lib = ["libfoo"]
# ...
Say I am overriding the library "libfoo" with the same prebuilt library for all targets. How would I avoid having to list out [target.<machine-vendor-os>.libfoo]
tables for all current and future targets? Is there a cfg(...)
expression that would achieve this?
Copyright Notice:Content Author:「kpozin」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/54974605/compactly-override-a-build-script-for-all-targets