diff options
Diffstat (limited to 'Modules/Compiler/Clang.cmake')
-rw-r--r-- | Modules/Compiler/Clang.cmake | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index 7cee9c7..c3f13f3 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -23,23 +23,9 @@ else() set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") # Link options for PIE are already set in 'Compiler/GNU.cmake' # but clang may require alternate syntax on some platforms - if (NOT CMAKE_${lang}_FLAG_PIE) - cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_COMPILE_OPTIONS_PIE};-Xlinker;-pie" - CMAKE_${lang}_FLAG_XLINKER_PIE) - if (CMAKE_${lang}_FLAG_XLINKER_PIE) - set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-Xlinker" "-pie") - else() - set(CMAKE_${lang}_LINK_OPTIONS_PIE "") - endif() - endif() - if (NOT CMAKE_${lang}_FLAG_NO_PIE) - cmake_check_compiler_flag(${lang} "-Xlinker;-no_pie" - CMAKE_${lang}_FLAG_XLINKER_NO_PIE) - if (CMAKE_${lang}_FLAG_XLINKER_NO_PIE) - set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-Xlinker" "-no_pie") - else() - set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "") - endif() + if (APPLE) + set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} -Xlinker -pie) + set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE -Xlinker -no_pie) endif() set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ") set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") |