Skip to content

Commit 64f2855

Browse files
committed
[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 8d26760. Differential Revision: https://reviews.llvm.org/D88756
1 parent c8e7392 commit 64f2855

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/runtimes/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
9898

9999
include(CheckLibraryExists)
100100
include(CheckCCompilerFlag)
101-
include(CMakePushCheckState)
102-
103-
cmake_push_check_state()
104101

105102
# We don't have libc++ (yet)...
106103
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdinc++ -nostdlib++")
@@ -118,7 +115,8 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
118115
include(HandleLLVMOptions)
119116
include(FindPythonInterp)
120117

121-
cmake_pop_check_state()
118+
# Remove the -nostdlib++ option we've added earlier.
119+
string(REPLACE "-nostdlib++" "" CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
122120

123121
# Use libtool instead of ar if you are both on an Apple host, and targeting Apple.
124122
if(CMAKE_HOST_APPLE AND APPLE)

0 commit comments

Comments
 (0)