cmake: make LTO optional

This commit is contained in:
Sebastian Krzyszkowiak 2019-02-13 22:53:43 +01:00
parent 23da896077
commit 379ba8f629
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF

View file

@ -142,7 +142,8 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
endif()
endif()
if(POLICY CMP0069)
option(LIBSUPERDERPY_LTO "Use link-time optimization" OFF)
if(POLICY CMP0069 AND LIBSUPERDERPY_LTO)
if(NOT USE_CLANG_TIDY AND NOT MINGW) # clang-tidy + GCC + LTO = errors; also, MinGW crashes
cmake_policy(SET CMP0069 NEW)
include(CheckIPOSupported)