[PATCH] D94817: [MSVC] Don't add -nostdinc++ -isystem to runtimes builds

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 13:22:22 PST 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG98c89ccfbd74: [MSVC] Don't add -nostdinc++ -isystem to runtimes builds (authored by rnk).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94817/new/

https://reviews.llvm.org/D94817

Files:
  runtimes/CMakeLists.txt


Index: runtimes/CMakeLists.txt
===================================================================
--- runtimes/CMakeLists.txt
+++ runtimes/CMakeLists.txt
@@ -77,12 +77,15 @@
 include(CheckLibraryExists)
 include(CheckCCompilerFlag)
 
-# We don't have libc++ (yet)...
-set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdinc++ -nostdlib++")
-
-# ...but we need access to libc++ headers for CMake checks to succeed.
-if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR AND "libcxx" IN_LIST LLVM_ENABLE_RUNTIMES)
-  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -isystem ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}/include")
+# Disable use of the installed C++ standard library when building runtimes. If
+# MSVC is true, we must be using the clang-cl driver, which doesn't understand
+# these flags.
+if (NOT MSVC)
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdinc++ -nostdlib++")
+
+  if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR AND "libcxx" IN_LIST LLVM_ENABLE_RUNTIMES)
+    set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -isystem ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}/include")
+  endif()
 endif()
 
 # Avoid checking whether the compiler is working.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94817.317060.patch
Type: text/x-patch
Size: 1142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210115/cf3d4f4e/attachment.bin>


More information about the llvm-commits mailing list