Disables LTO for mason+gcc

See https://github.com/Project-OSRM/node-osrm/pull/301
This commit is contained in:
Daniel J. Hofmann 2017-03-01 12:02:15 +01:00 committed by Patrick Niklaus
parent 886421b43a
commit 4fa3a5c362

View File

@ -162,6 +162,13 @@ if(ENABLE_GOLD_LINKER)
endif()
endif()
# Disable LTO when mason+gcc is detected before testing for / setting any flags.
# Mason builds libraries with Clang, mixing does not work in the context of lto.
if(ENABLE_MASON AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(ENABLE_LTO Off)
message(WARNING "Mason and GCC's LTO not work together. Disabling LTO.")
endif()
# Explicitly set the build type to Release if no other type is specified
# on the command line. Without this, cmake defaults to an unoptimized,
# non-debug build, which almost nobody wants.