[PATCH] D88756: [CMake] Don't use CMakePushCheckState

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 14:19:30 PDT 2020


phosek created this revision.
phosek added reviewers: beanz, smeenai.
Herald added subscribers: llvm-commits, mgorny.
Herald added a project: LLVM.
phosek requested review of this revision.

When we call cmake_pop_check_state, we undo any changes to REQUIRED
variables performed by HandleLLVMOptions which is undesirable. Rather
use replacement which is what we've used prior to de47e7122 <https://reviews.llvm.org/rGde47e7122f69d56399c4f8864ba279e5ce635970>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88756

Files:
  llvm/runtimes/CMakeLists.txt


Index: llvm/runtimes/CMakeLists.txt
===================================================================
--- llvm/runtimes/CMakeLists.txt
+++ llvm/runtimes/CMakeLists.txt
@@ -98,9 +98,6 @@
 
   include(CheckLibraryExists)
   include(CheckCCompilerFlag)
-  include(CMakePushCheckState)
-
-  cmake_push_check_state()
 
   # We don't have libc++ (yet)...
   set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdinc++ -nostdlib++")
@@ -118,7 +115,8 @@
   include(HandleLLVMOptions)
   include(FindPythonInterp)
 
-  cmake_pop_check_state()
+  # Remove the -nostdlib++ option we've added earlier.
+  string(REPLACE "-nostdlib++" "" CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
 
   # Use libtool instead of ar if you are both on an Apple host, and targeting Apple.
   if(CMAKE_HOST_APPLE AND APPLE)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88756.295907.patch
Type: text/x-patch
Size: 799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201002/fb35e3d8/attachment.bin>


More information about the llvm-commits mailing list