mirror of
https://github.com/Z3Prover/z3
synced 2025-09-03 00:28:06 +00:00
[CMake] Add support for link time optimization (LTO).
This analogous to the `--optimize` flag in the Python/Makefile build system except that we now support doing LTO with Clang/GCC as well. However it is probably best to avoid doing LTO with Clang or GCC for now because I see a bunch of warnings about ODR violations when building with LTO. LTO can be enabled with the new `LINK_TIME_OPTIMIZATION` option which is off by default.
This commit is contained in:
parent
fb403229bd
commit
0e1343e78d
3 changed files with 58 additions and 0 deletions
|
@ -383,6 +383,11 @@ if (BUILD_LIBZ3_SHARED)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Link time optimization
|
||||
################################################################################
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/compiler_lto.cmake)
|
||||
|
||||
################################################################################
|
||||
# Report default CMake flags
|
||||
################################################################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue