diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -682,7 +682,8 @@ endif() if (MSVC) - if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") + if ((NOT CMAKE_MSVC_RUNTIME_LIBRARY AND uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") + OR (CMAKE_MSVC_RUNTIME_LIBRARY MATCHES "Debug")) set(LIB_SUFFIX "d") else() set(LIB_SUFFIX "") diff --git a/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in b/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in --- a/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in +++ b/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in @@ -13,7 +13,7 @@ crt_lib = 'libcmt' cxx_lib = 'libcpmt' -if '@uppercase_CMAKE_BUILD_TYPE@' == 'DEBUG': +if (runtime_library == '' and '@uppercase_CMAKE_BUILD_TYPE@' == 'DEBUG') or 'Debug' in runtime_library: dbg_include = ' -D_DEBUG -include set_windows_crt_report_mode.h' crt_lib += 'd' cxx_lib += 'd' diff --git a/libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in b/libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in --- a/libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in +++ b/libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in @@ -14,7 +14,7 @@ crt_lib = 'libcmt' cxx_lib = 'libcpmt' -if '@uppercase_CMAKE_BUILD_TYPE@' == 'DEBUG': +if (runtime_library == '' and '@uppercase_CMAKE_BUILD_TYPE@' == 'DEBUG') or 'Debug' in runtime_library: dbg_include = ' -D_DEBUG -include set_windows_crt_report_mode.h' crt_lib += 'd' cxx_lib += 'd' diff --git a/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in b/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in --- a/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in +++ b/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in @@ -13,7 +13,7 @@ crt_lib = 'libcmt' cxx_lib = 'libcpmt' -if '@uppercase_CMAKE_BUILD_TYPE@' == 'DEBUG': +if (runtime_library == '' and '@uppercase_CMAKE_BUILD_TYPE@' == 'DEBUG') or 'Debug' in runtime_library: dbg_include = ' -D_DEBUG -include set_windows_crt_report_mode.h' crt_lib += 'd' cxx_lib += 'd'