CMake: Fix LTO flags for shared linking

This commit is contained in:
Michael Friedrich 2019-08-20 20:52:51 +02:00
parent 8c739fe33b
commit a99855be93
1 changed files with 1 additions and 1 deletions

View File

@ -314,7 +314,7 @@ if(ICINGA2_LTO_BUILD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0) AND NOT OPENBSD)
set(CMAKE_AR "gcc-ar")