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

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


rnk updated this revision to Diff 317054.
rnk added a comment.

- fix misleading comment


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.317054.patch
Type: text/x-patch
Size: 1142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210115/6cfb2dcd/attachment.bin>


More information about the libcxx-commits mailing list