Linking of binaries in large projects often results in processing of
thousands of linker inputs. In such projects, controlling all transitive
dependencies' inputs and libraries to be added to the final linker
command is (unfortunately) often too complex.
In theory the build system should provide a convenient way to simply
exclude a given library, but the reality is that few build systems do.
The simplest possible design, that will work across all build systems,
is therefore to pass an option to the linker to exclude inputs matching
a given pattern. The possible use cases are:
- Removing inputs added by dependencies (e.g. via pkg-config) where modification of the build scripts (or build systems such as Bazel) is infeasible.
- Replacing inputs added by dependencies where modification of the build scripts is infeasible.
- Replacing default inputs with custom implementations.
Introduce --exclude-inputs, which accomplishes just that.
no brace for cascading single-line while/for/if
Actually, it may be useful to add a log comment in --verbose mode.