[llvm] 64f2855 - [CMake] Don't use CMakePushCheckState

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 17:14:02 PDT 2020


Author: Petr Hosek
Date: 2020-10-02T17:13:34-07:00
New Revision: 64f2855f15d8496be2275ea82f8996868b618b15

URL: https://github.com/llvm/llvm-project/commit/64f2855f15d8496be2275ea82f8996868b618b15
DIFF: https://github.com/llvm/llvm-project/commit/64f2855f15d8496be2275ea82f8996868b618b15.diff

LOG: [CMake] Don't use CMakePushCheckState

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 8d26760a.

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

Added: 
    

Modified: 
    llvm/runtimes/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index ecf8ac45c9e7..598daa4502e1 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -98,9 +98,6 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
 
   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 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
   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)


        


More information about the llvm-commits mailing list