Skip to content

Commit

Permalink
Add support for building with LTO (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntadej authored Sep 5, 2024
1 parent 1ddbcca commit 8aa86a0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ option(MLN_QT_WITH_WIDGETS "Build QMapLibreWidgets" ON)
option(MLN_QT_STATIC "Build QMapLibre staticaly (force static build with Qt6)" OFF)
option(MLN_QT_WITH_COVERAGE "Build QMapLibre with code coverage collection" OFF)
option(MLN_QT_WITH_CLANG_TIDY "Build QMapLibre with clang-tidy checks enabled" OFF)
option(MLN_QT_WITH_LTO "Build QMapLibre with Link-Time Optimization" OFF)

if(MLN_QT_WITH_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_result OUTPUT ipo_output)
if(ipo_result)
message(STATUS "Building with LTO/IPO enabled")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING "LTO/IPO is not supported: ${ipo_output}")
endif()
endif()

# Find Qt
if("${QT_VERSION_MAJOR}" STREQUAL "")
Expand Down

0 comments on commit 8aa86a0

Please sign in to comment.