[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
This commit is contained in:
Petr Hosek 2020-10-02 14:16:27 -07:00
parent c8e73920ee
commit 64f2855f15
1 changed files with 2 additions and 4 deletions

View File

@ -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)