cmake: Move LTO settings lower in the file

This commit is contained in:
Florent Castelli 2017-01-25 05:51:09 +01:00
parent 925297d528
commit fafb103c52

View File

@ -230,14 +230,6 @@ if(NOT MSVC)
endif()
endif(NOT MSVC)
if(ENABLE_LTO)
check_and_add_flag(LTO -flto)
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
set(CMAKE_AR gcc-ar)
set(CMAKE_RANLIB gcc-ranlib)
endif()
endif()
if(APPLE)
# This doesn't play well with the packaging script that doesn't understand @rpath
set(CMAKE_MACOSX_RPATH OFF)
@ -292,6 +284,14 @@ if(APPLE)
)
endif()
if(ENABLE_LTO)
check_and_add_flag(LTO -flto)
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
set(CMAKE_AR gcc-ar)
set(CMAKE_RANLIB gcc-ranlib)
endif()
endif()
if(WIN32)
add_definitions(-D_SECURE_SCL=0)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)