Use gcc-ar and gcc-ranlib when building with -flto

This commit is contained in:
Gunnar Beutner 2018-01-17 14:26:37 +01:00
parent 2c7d738e36
commit 5f4a9c9655
1 changed files with 5 additions and 0 deletions

View File

@ -262,6 +262,11 @@ if(ICINGA2_LTO_BUILD)
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")
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")
set(CMAKE_RANLIB "gcc-ranlib")
endif()
endif()
endif()