Allow LTO with clang
Seem to work fine
This commit is contained in:
parent
2661c92394
commit
f7ccab0e7c
2 changed files with 12 additions and 10 deletions
|
|
@ -40,12 +40,8 @@ if (DESKTOP_APP_SPECIAL_TARGET)
|
||||||
target_compile_options(common_options INTERFACE -g0)
|
target_compile_options(common_options INTERFACE -g0)
|
||||||
target_link_options(common_options INTERFACE -g0)
|
target_link_options(common_options INTERFACE -g0)
|
||||||
else()
|
else()
|
||||||
target_compile_options(common_options INTERFACE $<IF:$<CONFIG:Debug>,,-g>)
|
target_compile_options(common_options INTERFACE $<IF:$<CONFIG:Debug>,,-g -flto>)
|
||||||
target_link_options(common_options INTERFACE $<IF:$<CONFIG:Debug>,,-g>)
|
target_link_options(common_options INTERFACE $<IF:$<CONFIG:Debug>,,-g -flto -fuse-linker-plugin>)
|
||||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
||||||
target_compile_options(common_options INTERFACE $<IF:$<CONFIG:Debug>,,-flto>)
|
|
||||||
target_link_options(common_options INTERFACE $<IF:$<CONFIG:Debug>,,-flto -fuse-linker-plugin>)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,10 +96,16 @@ else()
|
||||||
report_bad_special_target()
|
report_bad_special_target()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if (DESKTOP_APP_SPECIAL_TARGET AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
if (DESKTOP_APP_SPECIAL_TARGET)
|
||||||
set(CMAKE_AR "gcc-ar")
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
set(CMAKE_RANLIB "gcc-ranlib")
|
set(CMAKE_AR "gcc-ar")
|
||||||
set(CMAKE_NM "gcc-nm")
|
set(CMAKE_RANLIB "gcc-ranlib")
|
||||||
|
set(CMAKE_NM "gcc-nm")
|
||||||
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
|
set(CMAKE_AR "llvm-ar")
|
||||||
|
set(CMAKE_RANLIB "llvm-ranlib")
|
||||||
|
set(CMAKE_NM "llvm-nm")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue