2021-04-03 14:51:17 +08:00
|
|
|
include(CheckLinkerFlag OPTIONAL)
|
|
|
|
|
|
|
|
if (COMMAND check_linker_flag)
|
|
|
|
macro(llvm_check_linker_flag)
|
|
|
|
check_linker_flag(${ARGN})
|
|
|
|
endmacro()
|
|
|
|
else()
|
|
|
|
include(CheckCXXCompilerFlag)
|
2021-04-28 08:16:57 +08:00
|
|
|
include(CMakePushCheckState)
|
2021-04-03 14:51:17 +08:00
|
|
|
|
|
|
|
# cmake builtin compatible, except we assume lang is CXX
|
|
|
|
function(llvm_check_linker_flag lang flag out_var)
|
|
|
|
cmake_push_check_state()
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag}")
|
|
|
|
check_cxx_compiler_flag("" ${out_var})
|
|
|
|
cmake_pop_check_state()
|
|
|
|
endfunction()
|
|
|
|
endif()
|