MSVC: Add abstraction for runtime library selection
CMake currently hard codes defaults for /MD
and /MDd
. There is a FAQ entry on how to change them but the process is not simple and requires knowing CMake's existing default. That means we cannot even change our default from /MD
to -MD
without a policy.
Instead we should introduce a first-class abstraction for choosing the MSVC runtime library via an enumeration. We've long hesitated to do this because the idea of "runtime library selection" touches on related concepts on several platforms. We can avoid that scope creep by simply defining an abstraction that applies only when targeting the MSVC ABI on Windows (regardless of what compiler is being used).
Edited by Brad King