From: Petr Hosek Date: Fri, 2 Oct 2020 21:16:27 +0000 (-0700) Subject: [CMake] Don't use CMakePushCheckState X-Git-Tag: llvmorg-13-init~10231 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64f2855f15d8496be2275ea82f8996868b618b15;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt index ecf8ac4..598daa4 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)