Skip to content

feat(cmake): optional ENABLE_LTO (IPO) for release packaging#9

Merged
cursor[bot] merged 1 commit intomainfrom
cursor/optional-lto-39fd
Apr 27, 2026
Merged

feat(cmake): optional ENABLE_LTO (IPO) for release packaging#9
cursor[bot] merged 1 commit intomainfrom
cursor/optional-lto-39fd

Conversation

@timfox
Copy link
Copy Markdown
Owner

@timfox timfox commented Apr 27, 2026

Summary

Adds ENABLE_LTO (default OFF) for packagers who want IPO/LTO on Release, RelWithDebInfo, and MinSizeRel builds.

  • New cmake/ETLLTO.cmake: uses CMake CheckIPOSupported; sets CMAKE_INTERPROCEDURAL_OPTIMIZATION_* when supported; fatal if combined with ENABLE_ASAN.
  • ENABLE_LTO is declared after LEG_BUNDLED_LIB so cmake -DENABLE_LTO=ON alone still gets bundled libs default-on.
  • README: short section on enabling LTO for release packaging.

Default CI behavior is unchanged (option stays off).

Testing

Please confirm ci.yml passes on this branch.

Open in Web Open in Cursor 

- New cmake/ETLLTO.cmake: CheckIPOSupported, gate on ENABLE_LTO, forbid
  combination with ENABLE_ASAN.
- ENABLE_LTO option declared after LEG_BUNDLED_LIB so bundled libs stay
  default-on when configuring with -DENABLE_LTO only.
- README: document -DENABLE_LTO=ON for packagers.

Co-authored-by: Tim Fox <timfox@outlook.com>
@cursor cursor Bot merged commit f2b70cd into main Apr 27, 2026
10 checks passed
@cursor cursor Bot deleted the cursor/optional-lto-39fd branch April 27, 2026 00:46
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.

2 participants