[CMake] Don't use libc++ by default on Windows yet
authorPetr Hosek <phosek@google.com>
Wed, 9 Jun 2021 05:44:53 +0000 (22:44 -0700)
committerPetr Hosek <phosek@google.com>
Wed, 9 Jun 2021 06:57:14 +0000 (23:57 -0700)
libc++ has issues when used with -fno-exceptions and vcruntime,
don't use it on Windows by default until we address those issues.

Differential Revision: https://reviews.llvm.org/D103941

clang/cmake/caches/Fuchsia-stage2.cmake
clang/cmake/caches/Fuchsia.cmake

index 60eb627..bc955b1 100644 (file)
@@ -30,7 +30,9 @@ if(WIN32)
   set(LLVM_USE_CRT_RELEASE "MT" CACHE STRING "")
 endif()
 
-set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
+if(NOT WIN32)
+  set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
+endif()
 if(NOT APPLE)
   # TODO: Remove this once we switch to ld64.lld.
   set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
@@ -93,7 +95,6 @@ if(WIN32)
   set(RUNTIMES_${target}_LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
   set(RUNTIMES_${target}_LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
   set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
-  set(RUNTIMES_${target}_LIBCXX_NO_VCRUNTIME ON CACHE BOOL "")
   set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "")
 endif()
 
index 2f65800..bb88ff7 100644 (file)
@@ -21,7 +21,9 @@ if(WIN32)
   set(LLVM_USE_CRT_RELEASE "MT" CACHE STRING "")
 endif()
 
-set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
+if(NOT WIN32)
+  set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
+endif()
 if(NOT APPLE)
   # TODO: Remove this once we switch to ld64.lld.
   set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
@@ -66,7 +68,6 @@ if(WIN32)
   set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
   set(LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
   set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY OFF CACHE BOOL "")
-  set(LIBCXX_NO_VCRUNTIME ON CACHE BOOL "")
   set(BUILTINS_CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Windows CACHE STRING "")
   set(RUNTIMES_CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Windows CACHE STRING "")
   set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "")