From 24cca08ccf5cb1285b5381d50e330920b4940376 Mon Sep 17 00:00:00 2001 From: dehnert Date: Thu, 1 Mar 2018 09:28:18 +0100 Subject: [PATCH] disabling LTO for gcc >= 7 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e78152e06..f284dae11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,9 +181,15 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") set(STORM_COMPILER_ID "AppleClang") set(CMAKE_MACOSX_RPATH ON) elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set(GCC ON) # using GCC if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) message(FATAL_ERROR "gcc version must be at least 5.0.") + elseif (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + if (STORM_USE_LTO) + set(STORM_USE_LTO OFF) + message(WARNING "Disabling link-time optimization, because of known incompatibility of LTO with gcc >= 7.") + endif() endif() set(STORM_COMPILER_GCC ON)