From fafb103c52cf9d48f2397554fd2369ab397951bf Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Wed, 25 Jan 2017 05:51:09 +0100 Subject: [PATCH] cmake: Move LTO settings lower in the file --- CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f734fce96a..e9dbcb9aa6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)