Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable LTO building on supported platforms by default #13192

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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()