mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
b65a04dcd7
`check_linker_flags` currently sets the *compiler* flags (via `CMAKE_REQUIRED_FLAGS`), and thus implicitly relies on cmake's default behavior of passing the compiler flags to the linker. This breaks when cmake's build rules have been altered to not pollute the link line with compiler flags (which can be desirable for build cleanliness). Instead, set `CMAKE_EXE_LINKER_FLAGS` explicitly and use `CMP0056` to ensure the linker flags are passed along. Additionally, since we're inside a function, we can just alter the variable directly (as the alteration will be limited to the scope of the function) rather than saving and restoring the old value. Differential Revision: https://reviews.llvm.org/D39431 llvm-svn: 316972
7 lines
193 B
CMake
7 lines
193 B
CMake
include(CheckCXXCompilerFlag)
|
|
|
|
function(check_linker_flag flag out_var)
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag}")
|
|
check_cxx_compiler_flag("" ${out_var})
|
|
endfunction()
|