mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Cmake build: Select use of interprocedural optimization
New cmake-option to explicit select/deselect the IPO
This commit is contained in:
parent
86ba7409a4
commit
3a29ba795d
5
3rdparty/hunspell/CMakeLists.txt
vendored
5
3rdparty/hunspell/CMakeLists.txt
vendored
@ -3,10 +3,9 @@ cmake_minimum_required(VERSION 3.1)
|
|||||||
|
|
||||||
set(LYX_IPO_SUPPORTED FALSE)
|
set(LYX_IPO_SUPPORTED FALSE)
|
||||||
if (POLICY CMP0069)
|
if (POLICY CMP0069)
|
||||||
if (NOT LYX_DEBUG)
|
|
||||||
cmake_policy(SET CMP0069 NEW)
|
cmake_policy(SET CMP0069 NEW)
|
||||||
include(CheckIPOSupported)
|
if (LYX_USE_IPO MATCHES "ON")
|
||||||
check_ipo_supported(RESULT LYX_IPO_SUPPORTED)
|
set(LYX_IPO_SUPPORTED YES)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
5
3rdparty/libiconv/CMakeLists.txt
vendored
5
3rdparty/libiconv/CMakeLists.txt
vendored
@ -9,10 +9,9 @@ cmake_minimum_required(VERSION 3.1)
|
|||||||
|
|
||||||
set(LYX_IPO_SUPPORTED FALSE)
|
set(LYX_IPO_SUPPORTED FALSE)
|
||||||
if (POLICY CMP0069)
|
if (POLICY CMP0069)
|
||||||
if (NOT LYX_DEBUG)
|
|
||||||
cmake_policy(SET CMP0069 NEW)
|
cmake_policy(SET CMP0069 NEW)
|
||||||
include(CheckIPOSupported)
|
if (LYX_USE_IPO MATCHES "ON")
|
||||||
check_ipo_supported(RESULT LYX_IPO_SUPPORTED)
|
set(LYX_IPO_SUPPORTED YES)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
6
3rdparty/mythes/CMakeLists.txt
vendored
6
3rdparty/mythes/CMakeLists.txt
vendored
@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 3.1)
|
|||||||
|
|
||||||
set(LYX_IPO_SUPPORTED FALSE)
|
set(LYX_IPO_SUPPORTED FALSE)
|
||||||
if (POLICY CMP0069)
|
if (POLICY CMP0069)
|
||||||
if (NOT LYX_DEBUG)
|
|
||||||
cmake_policy(SET CMP0069 NEW)
|
cmake_policy(SET CMP0069 NEW)
|
||||||
include(CheckIPOSupported)
|
if (LYX_USE_IPO MATCHES "ON")
|
||||||
check_ipo_supported(RESULT LYX_IPO_SUPPORTED)
|
set(LYX_IPO_SUPPORTED YES)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
set(VERSION "1.2.5")
|
set(VERSION "1.2.5")
|
||||||
set(SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/${VERSION})
|
set(SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/${VERSION})
|
||||||
|
|
||||||
|
5
3rdparty/zlib/CMakeLists.txt
vendored
5
3rdparty/zlib/CMakeLists.txt
vendored
@ -2,10 +2,9 @@ cmake_minimum_required(VERSION 3.1)
|
|||||||
|
|
||||||
set(LYX_IPO_SUPPORTED FALSE)
|
set(LYX_IPO_SUPPORTED FALSE)
|
||||||
if (POLICY CMP0069)
|
if (POLICY CMP0069)
|
||||||
if (NOT LYX_DEBUG)
|
|
||||||
cmake_policy(SET CMP0069 NEW)
|
cmake_policy(SET CMP0069 NEW)
|
||||||
include(CheckIPOSupported)
|
if (LYX_USE_IPO MATCHES "ON")
|
||||||
check_ipo_supported(RESULT LYX_IPO_SUPPORTED)
|
set(LYX_IPO_SUPPORTED YES)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -81,15 +81,6 @@ if(NOT help AND NOT HELP)
|
|||||||
message(FATAL_ERROR "Exiting")
|
message(FATAL_ERROR "Exiting")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
# Enable LTO if supported and not debugging
|
|
||||||
set(LYX_IPO_SUPPORTED FALSE)
|
|
||||||
if (POLICY CMP0069)
|
|
||||||
if (NOT LYX_DEBUG)
|
|
||||||
cmake_policy(SET CMP0069 NEW)
|
|
||||||
include(CheckIPOSupported)
|
|
||||||
check_ipo_supported(RESULT LYX_IPO_SUPPORTED)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
@ -151,6 +142,7 @@ LYX_OPTION(ENABLE_KEYTESTS "Enable for keytests" OFF ALL)
|
|||||||
LYX_OPTION(ASAN "Use address sanitizer" OFF ALL)
|
LYX_OPTION(ASAN "Use address sanitizer" OFF ALL)
|
||||||
LYX_COMBO(USE_FILEDIALOG "Use native or QT file dialog" QT NATIVE)
|
LYX_COMBO(USE_FILEDIALOG "Use native or QT file dialog" QT NATIVE)
|
||||||
LYX_COMBO(USE_QT "Use Qt version as frontend" AUTO QT4 QT5)
|
LYX_COMBO(USE_QT "Use Qt version as frontend" AUTO QT4 QT5)
|
||||||
|
LYX_COMBO(USE_IPO "Interprocedural optimization" OFF AUTO ON)
|
||||||
#LYX_OPTION(3RDPARTY_BUILD "Build 3rdparty libs" OFF ALL)
|
#LYX_OPTION(3RDPARTY_BUILD "Build 3rdparty libs" OFF ALL)
|
||||||
LYX_OPTION(DISABLE_CALLSTACK_PRINTING "do not print a callstack when crashing" OFF ALL)
|
LYX_OPTION(DISABLE_CALLSTACK_PRINTING "do not print a callstack when crashing" OFF ALL)
|
||||||
LYX_OPTION(EXTERNAL_Z "OFF := Build 3rdparty lib zlib" ON ALL)
|
LYX_OPTION(EXTERNAL_Z "OFF := Build 3rdparty lib zlib" ON ALL)
|
||||||
@ -250,8 +242,6 @@ if(LYX_DEPENDENCIES_DOWNLOAD)
|
|||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
message(STATUS)
|
message(STATUS)
|
||||||
|
|
||||||
set(EXECUTABLE_OUTPUT_PATH ${TOP_BINARY_DIR}/bin)
|
set(EXECUTABLE_OUTPUT_PATH ${TOP_BINARY_DIR}/bin)
|
||||||
@ -261,6 +251,24 @@ else()
|
|||||||
set(LIBRARY_OUTPUT_PATH ${TOP_BINARY_DIR}/lib)
|
set(LIBRARY_OUTPUT_PATH ${TOP_BINARY_DIR}/lib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(LYX_IPO_SUPPORTED OFF)
|
||||||
|
if (POLICY CMP0069)
|
||||||
|
cmake_policy(SET CMP0069 NEW)
|
||||||
|
if(LYX_USE_IPO MATCHES "AUTO")
|
||||||
|
# Enable LTO if supported and not debugging
|
||||||
|
if (NOT LYX_DEBUG)
|
||||||
|
include(CheckIPOSupported)
|
||||||
|
check_ipo_supported(RESULT LYX_IPO_SUPPORTED)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(LYX_IPO_SUPPORTED ${LYX_USE_IPO})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if (LYX_IPO_SUPPORTED)
|
||||||
|
set(LYX_USE_IPO "ON" CACHE STRING "Use interprocedural optimization" FORCE)
|
||||||
|
else()
|
||||||
|
set(LYX_USE_IPO "OFF" CACHE STRING "Use interprocedural optimization" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Set to some meaningful default
|
# Set to some meaningful default
|
||||||
find_package(CXX11Compiler)
|
find_package(CXX11Compiler)
|
||||||
|
Loading…
Reference in New Issue
Block a user