Disable LTO because crypto++ has problems with it

This commit is contained in:
Sebastian Messmer 2021-04-25 17:19:08 -07:00
parent 46ada21a30
commit 5cf5816675
2 changed files with 1 additions and 15 deletions

View File

@ -37,20 +37,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE INTERNAL "CMAKE_BUILD_TYPE")
endif(NOT CMAKE_BUILD_TYPE)
# Enable LTO if we're in a release build and LTO is supported
string(TOUPPER ${CMAKE_BUILD_TYPE} _CMAKE_BUILD_TYPE_UPPER)
if (_CMAKE_BUILD_TYPE_UPPER STREQUAL "DEBUG")
message(STATUS "LTO disabled because we're in a debug build")
else()
include(CheckIPOSupported)
check_ipo_supported(RESULT LTO_SUPPORTED OUTPUT error)
if(LTO_SUPPORTED)
message(STATUS "LTO enabled")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING "LTO disabled because compiler does not support it.")
endif()
endif()
# We don't use LTO because crypto++ has problems with it, see https://github.com/weidai11/cryptopp/issues/1031 and https://www.cryptopp.com/wiki/Link_Time_Optimization
# The MSVC version on AppVeyor CI needs this
if(MSVC)

View File

@ -15,7 +15,6 @@ New platforms:
Build changes:
* Switch to Conan package manager
* Allow an easy way to modify how the dependencies are found. This is mostly helpful for package maintainers.
* Build with LTO if the compiler supports it
* Build with macFUSE instead of osxfuse on OSX
* Now requires CMake 3.10 or later, and GCC 7 or later, or Clang 7 or later