We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
CMake v3.9 finally supports LTO.
Here's an example code to show how it works:
cmake_minimum_required(VERSION 3.9.4) include(CheckIPOSupported) check_ipo_supported(RESULT supported OUTPUT error) add_executable(example Example.cpp) if (supported) message(STATUS "IPO / LTO enabled") set_property(TARGET example PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) else () message(STATUS "IPO / LTO not supported: <${error}>") endif()
See also:
The text was updated successfully, but these errors were encountered:
This code enables LTO (if available):
project(VITA) include(CheckIPOSupported) ... if (CMAKE_BUILD_TYPE MATCHES "Release") check_ipo_supported(RESULT supported_ipo OUTPUT error_ipo) if (supported_ipo) message(STATUS "IPO / LTO supported: <${supported_ipo}>") set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) else () message(STATUS "IPO / LTO not supported: <${error_ipo}>") endif() endif()
Unfortunately preliminary tests show worse performance. Further investigation required...
Sorry, something went wrong.
No branches or pull requests
CMake v3.9 finally supports LTO.
Here's an example code to show how it works:
See also:
The text was updated successfully, but these errors were encountered: