Use LTO by default

The mingw toolchains override this for now.
This commit is contained in:
Zachary Michaels 2014-08-07 19:34:10 -04:00 committed by Riccardo Spagni
parent 59c1ac503f
commit ed41ee4c26
3 changed files with 6 additions and 1 deletions

View File

@ -119,7 +119,10 @@ else()
set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable")
set(USE_LTO false CACHE BOOL "Use Link-Time Optimization (Release mode only)")
if(NOT DEFINED USE_LTO_DEFAULT)
set(USE_LTO_DEFAULT true)
endif()
set(USE_LTO ${USE_LTO_DEFAULT} CACHE BOOL "Use Link-Time Optimization (Release mode only)")
if(USE_LTO)
# There is a clang bug that does not allow to compile code that uses AES-NI intrinsics if -flto is enabled
set(RELEASE_FLAGS "${RELEASE_FLAGS} -flto")

View File

@ -16,3 +16,4 @@ set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target
set (MINGW_FLAG "-m32")
set (USE_LTO_DEFAULT false)

View File

@ -16,3 +16,4 @@ set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target
set (MINGW_FLAG "-m64")
set (USE_LTO_DEFAULT false)