Adding IPO support.

This commit is contained in:
Pcornat 2025-03-08 13:38:47 +01:00
parent cc623bcdeb
commit 882c48acb9
Signed by: Pcornat
GPG key ID: E0326CC678A00BDD
3 changed files with 18 additions and 1 deletions

View file

@ -1,8 +1,10 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.18)
project(qwt VERSION 6.1.3 LANGUAGES CXX)
option(WITH_EXAMPLES "Whether to include examples" OFF)
include(CheckIPOSupported)
add_subdirectory(src)
add_subdirectory(textengines)

View file

@ -221,6 +221,8 @@ set(qwt_sources
#----------------------------------------------------------------
# Target
#----------------------------------------------------------------
check_ipo_supported(RESULT result OUTPUT output)
if(QWT_USE_STATIC_LIBS)
add_library(qwt STATIC ${qwt_headers} ${qwt_sources})
else()
@ -234,6 +236,13 @@ else()
)
endif()
check_ipo_supported(RESULT result OUTPUT output)
if(result)
set_target_properties(qwt PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
else()
message(WARNING "IPO is not supported: ${output}")
endif()
target_include_directories(qwt
PUBLIC
${PROJECT_SOURCE_DIR}/include

View file

@ -20,6 +20,12 @@ set(qwt_mathml_sources
# Target
#----------------------------------------------------------------
add_library(qwt_mathml SHARED ${qwt_mathml_headers} ${qwt_mathml_sources})
check_ipo_supported(RESULT result OUTPUT output)
if(result)
set_target_properties(qwt_mathml PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
else()
message(WARNING "IPO is not supported: ${output}")
endif()
target_include_directories(qwt_mathml
PUBLIC