diff --git a/runtime/cmake/clang-cl-xwin.cmake b/runtime/cmake/clang-cl-xwin.cmake index 94d78d5944..7ebe5b3167 100644 --- a/runtime/cmake/clang-cl-xwin.cmake +++ b/runtime/cmake/clang-cl-xwin.cmake @@ -53,6 +53,13 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT _xwin_debug_crt) endif() set(CMAKE_TRY_COMPILE_CONFIGURATION Release) +# Ensure static MSVC runtime (/MT) so D3D12 test executables don't import msvcp140.dll +# (7 tests were hitting msvcp140.dll!??0ios_base@std@@IEAA@XZ even with -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded +# on the command line; setting it here propagates to all targets including shared helpers). +if(NOT CMAKE_MSVC_RUNTIME_LIBRARY) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +endif() + # The Vulkan headers are the same on every platform, but /usr/include also holds glibc's, which must not shadow the # MSVC CRT. Point Vulkan_INCLUDE_DIR at a folder that holds only vulkan/ and vk_video/ (links to the host copies), # unless another folder was given (-DVulkan_INCLUDE_DIR=/include). The links are (re)made on every