Description
We currently pass a large subset or all of the configure/cmake flags through to 3rdparty dependencies. This is bad for a number of reasons:
- bundled dependencies might not understand some of our flags or behave in unpredictable ways
- in the cmake build this requires us to introduce workarounds to deal with multi-config generators or library name suffixes (e.g., CMAKE_DEBUG_POSTFIX for protobuf)
- injecting custom compiler flags can break bundled deps, e.g., a bundled protoc cannot be executed when built with ASAN.
We should instead consider always building any bundled dependencies with a static configuration, e.g., always use optimized+debug or even only optimize to require fewer workarounds. If we would never install the 3rdparty dependencies built from bundled sources we could also opt for a unoptimized+debug config.