[cmake] Always respect existing CMAKE_REQUIRED_FLAGS when adding additional ones.

* Previously part of https://reviews.llvm.org/D41622.

llvm-svn: 323171
This commit is contained in:
Don Hinton 2018-01-23 03:30:23 +00:00
parent 4801624ee3
commit 66ddb50e44
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ INCLUDE(CheckCXXSourceCompiles)
function(check_cxx_atomics varname)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "-nodefaultlibs -std=c++11 -nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs -std=c++11 -nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include")
if (${LIBCXX_GCC_TOOLCHAIN})
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} --gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}")
endif()