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/CMakeLists.txt b/libcxx/test/CMakeLists.txt --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -59,7 +59,8 @@ set(cxx_lib "libcpmt") endif() - 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(dbg_include " -D_DEBUG -include set_windows_crt_report_mode.h") set(crt_lib "${crt_lib}d") set(cxx_lib "${cxx_lib}d")