[cmake] Use LLVM's check_linker_flag

LLVM already defines this function, so make use of it instead of rolling
our own.

llvm-svn: 333808
This commit is contained in:
Shoaib Meenai 2018-06-02 00:49:54 +00:00
parent 4a2798c934
commit 9c0d10ab6b
1 changed files with 1 additions and 8 deletions

View File

@ -99,14 +99,7 @@ if (APPLE)
endif()
if(CLANG_ORDER_FILE AND (LD64_EXECUTABLE OR GOLD_EXECUTABLE))
include(CMakePushCheckState)
function(check_linker_flag flag out_var)
cmake_push_check_state()
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}")
check_cxx_compiler_flag("" ${out_var})
cmake_pop_check_state()
endfunction()
include(CheckLinkerFlag)
if (LD64_EXECUTABLE)
set(LINKER_ORDER_FILE_OPTION "-Wl,-order_file,${CLANG_ORDER_FILE}")