GetErrcMessages.cmake module makes use of cmake's try_run which by
default builds its sources in debug mode unless configured with
CMAKE_TRY_COMPILE_CONFIGURATION. Debug builds on Windows sometimes fail
when appropraite DLLs are not included in path. Also on Windows on Arm
machines debug builds sometimes fail to link the correct debug DLLs.
To fix this I am setting CMAKE_TRY_COMPILE_CONFIGURATION to active build
configuration of currently configured LLVM project. This makes sure we
select same build type for try_run/try_compile cmake modules as
currently configured LLVM project.
nit: I think it might be great to add a comment that once LLVM uses cmake 3.17 as minimum, the code can be simplified to just always use CMAKE_DEFAULT_BUILD_TYPE in the CMAKE_CONFIGURATION_TYPES case (since that gets initialized with the first element in CMAKE_CONFIGURATION_TYPES). Until then I like this approach of already using it if a user were to define it, even prior to 3.17.