From e4d30dd7f6c8b9de7eb9445717a7c314556b06da Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Tue, 30 Jul 2019 15:19:56 +0200 Subject: [PATCH] Cmake build: Disable interprocedural optimization if debugging --- 3rdparty/hunspell/CMakeLists.txt | 6 +++++- 3rdparty/mythes/CMakeLists.txt | 6 +++++- CMakeLists.txt | 12 ++++-------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/3rdparty/hunspell/CMakeLists.txt b/3rdparty/hunspell/CMakeLists.txt index dfa9a287c0..ad67b43865 100644 --- a/3rdparty/hunspell/CMakeLists.txt +++ b/3rdparty/hunspell/CMakeLists.txt @@ -2,7 +2,11 @@ cmake_minimum_required(VERSION 3.1) if (POLICY CMP0069) - cmake_policy(SET CMP0069 NEW) + if (LYX_DEBUG) + cmake_policy(SET CMP0069 OLD) + else() + cmake_policy(SET CMP0069 NEW) + endif() endif() project(hunspell) diff --git a/3rdparty/mythes/CMakeLists.txt b/3rdparty/mythes/CMakeLists.txt index 9457df2b73..d970ef23c3 100644 --- a/3rdparty/mythes/CMakeLists.txt +++ b/3rdparty/mythes/CMakeLists.txt @@ -1,7 +1,11 @@ cmake_minimum_required(VERSION 3.1) if (POLICY CMP0069) - cmake_policy(SET CMP0069 NEW) + if (LYX_DEBUG) + cmake_policy(SET CMP0069 OLD) + else() + cmake_policy(SET CMP0069 NEW) + endif() endif() set(VERSION "1.2.5") diff --git a/CMakeLists.txt b/CMakeLists.txt index e4e2789084..f759d8f45b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,16 +81,12 @@ if(NOT help AND NOT HELP) message(FATAL_ERROR "Exiting") endif() endif() - # Enable LTO if supported + # Enable LTO if supported and not debugging if (POLICY CMP0069) - cmake_policy(SET CMP0069 NEW) - include(CheckIPOSupported) - check_ipo_supported(RESULT result OUTPUT reason LANGUAGES CXX) - if(result) - message(STATUS "Setting IPO True") - set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + if (LYX_DEBUG) + cmake_policy(SET CMP0069 OLD) else() - message(STATUS "Not setting IPO , result = ${result}, reason = ${reason}") + cmake_policy(SET CMP0069 NEW) endif() endif() endif()