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

CMake: Add support for CMAKE_LTO option. #4799

Closed
wants to merge 1 commit into from
Closed

CMake: Add support for CMAKE_LTO option. #4799

wants to merge 1 commit into from

Conversation

@tru
Copy link
Contributor

tru commented Jan 9, 2020

This enables Link Time Optimization. LTO is a proven technique for optimizing across compilation units.

This is supported with the right setup on GCC, Clang and MSVC.

I only turn it on for the Release and RelWithDebInfo build types. It doesn't make to much sense on debug builds.

This should be fairly easy to port to the autoconf build system if you know what to do (I don't unfortunately).

CMakeLists.txt Outdated Show resolved Hide resolved
@bagder bagder added the cmake label Jan 9, 2020
tests/libtest/CMakeLists.txt Outdated Show resolved Hide resolved
This enables Link Time Optimization. LTO is a
proven technique for optimizing across compilation units.
@tru tru force-pushed the tru:curl_lto branch from 59cdd88 to 2bf2780 Jan 10, 2020
@tru

This comment has been minimized.

Copy link
Contributor Author

tru commented Jan 10, 2020

Updated to address the feedback in the C/R by @bagder and @jzakrzewski

@tru

This comment has been minimized.

Copy link
Contributor Author

tru commented Jan 13, 2020

I looked over the appveyor and travis ci errors - but they seem to be unrelated to my changes. Let me know if there is anything more I should change. Should we maybe have some CI test with CURL_ENABLE_LTO as well?

@bagder

This comment has been minimized.

Copy link
Member

bagder commented Jan 13, 2020

The red builds seems unrelated, agreed.

It'd be great to perhaps change one of the existing cmake builds to use this feature indeed. I think it would make sense to do that as a separate PR. I'll merge this now and then changing a CI build should be easy. There are cmake builds on both travis and Azure to play with.

@bagder bagder closed this in 4ccf762 Jan 13, 2020
@bagder

This comment has been minimized.

Copy link
Member

bagder commented Jan 13, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.