Skip to content

Commit

Permalink
enable LTO building on supported platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
tamara-schmitz committed Mar 23, 2023
1 parent 9af587c commit f44a83e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Expand Up @@ -394,3 +394,15 @@ if(DOXYGEN_FOUND)
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif()

# enable LTO / IPO
if (CMAKE_BUILD_TYPE STREQUAL Release)
include(CheckIPOSupported)
check_ipo_supported(RESULT result OUTPUT error)
if( result )
message(STATUS "LTO / IPO enabled")
set(INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(STATUS "LTO / IPO not supported: <${error}>")
endif()
endif()

0 comments on commit f44a83e

Please sign in to comment.