Cmake build: Disable interprocedural optimization if debugging

This commit is contained in:
Kornel Benko 2019-07-30 15:19:56 +02:00
parent 992fe6561e
commit e4d30dd7f6
3 changed files with 14 additions and 10 deletions

View File

@ -2,7 +2,11 @@
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
if (POLICY CMP0069) if (POLICY CMP0069)
if (LYX_DEBUG)
cmake_policy(SET CMP0069 OLD)
else()
cmake_policy(SET CMP0069 NEW) cmake_policy(SET CMP0069 NEW)
endif()
endif() endif()
project(hunspell) project(hunspell)

View File

@ -1,7 +1,11 @@
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
if (POLICY CMP0069) if (POLICY CMP0069)
if (LYX_DEBUG)
cmake_policy(SET CMP0069 OLD)
else()
cmake_policy(SET CMP0069 NEW) cmake_policy(SET CMP0069 NEW)
endif()
endif() endif()
set(VERSION "1.2.5") set(VERSION "1.2.5")

View File

@ -81,16 +81,12 @@ if(NOT help AND NOT HELP)
message(FATAL_ERROR "Exiting") message(FATAL_ERROR "Exiting")
endif() endif()
endif() endif()
# Enable LTO if supported # Enable LTO if supported and not debugging
if (POLICY CMP0069) if (POLICY CMP0069)
cmake_policy(SET CMP0069 NEW) if (LYX_DEBUG)
include(CheckIPOSupported) cmake_policy(SET CMP0069 OLD)
check_ipo_supported(RESULT result OUTPUT reason LANGUAGES CXX)
if(result)
message(STATUS "Setting IPO True")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else() else()
message(STATUS "Not setting IPO , result = ${result}, reason = ${reason}") cmake_policy(SET CMP0069 NEW)
endif() endif()
endif() endif()
endif() endif()