Skip to content

Respect explicit CMake IPO configuration - #401

Open
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/respect-ipo-off
Open

Respect explicit CMake IPO configuration#401
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/respect-ipo-off

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Addresses the IPO/LTO part of #392.

Summary

Release builds default CMAKE_INTERPROCEDURAL_OPTIMIZATION to ON. The current condition checks NOT CMAKE_INTERPROCEDURAL_OPTIMIZATION, which means an explicit -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF also enters that branch and is immediately changed back to ON.

This changes the defaulting condition to NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION.

The result is:

  • Release builds still enable IPO by default when the user did not configure it.
  • Explicit ON remains enabled.
  • Explicit OFF is respected, allowing users to disable LTO for toolchains where it causes compiler or linker failures.

Validation

  • Final diff: 1 file, +2/-1 lines, one commit, with no unrelated changes.
  • Branch is based on current upstream main at ff572a21e7c2bf9fda62e1862a758da7e9a8719b.
  • Full builds with the affected Ubuntu toolchains were not run locally in this environment; upstream CI should validate the CMake configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant