aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Michaels <mikezackles@gmail.com>2014-08-07 19:34:10 -0400
committerRiccardo Spagni <ric@spagni.net>2014-09-15 22:36:58 +0200
commited41ee4c264ee26cd786eebf1476f97dbe81c9b8 (patch)
tree73e8374988db4b5c1adcde8b10525679142217c1
parentMove toolchain files (diff)
downloadmonero-ed41ee4c264ee26cd786eebf1476f97dbe81c9b8.tar.xz
Use LTO by default
The mingw toolchains override this for now.
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt5
-rw-r--r--msys2/32-bit-toolchain.cmake1
-rw-r--r--msys2/64-bit-toolchain.cmake1
3 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 857e927ff..e182f7144 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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")
diff --git a/msys2/32-bit-toolchain.cmake b/msys2/32-bit-toolchain.cmake
index 111122a91..91665a21b 100644
--- a/msys2/32-bit-toolchain.cmake
+++ b/msys2/32-bit-toolchain.cmake
@@ -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)
diff --git a/msys2/64-bit-toolchain.cmake b/msys2/64-bit-toolchain.cmake
index 8884ae28d..93d69d898 100644
--- a/msys2/64-bit-toolchain.cmake
+++ b/msys2/64-bit-toolchain.cmake
@@ -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)