diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2020-10-07 08:15:20 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2020-10-07 08:15:20 +0200 |
commit | 144c106c4ec2b45581e1bcca4b36f30d417b4393 (patch) | |
tree | dd6f8df213ee14bd2cbc9751907e8b674d6d9f9b /CMakeLists.txt | |
parent | b1310aea9553efaac89d18ff0c80e44ffe128945 (diff) | |
download | ccache-144c106c4ec2b45581e1bcca4b36f30d417b4393.tar.gz |
Add option for enabling interprocedural (link time, LTO) optimization
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f80a9c92..77fbd2cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,14 @@ include(StandardWarnings) include(CIBuildType) include(DefaultBuildType) +if(NOT ${CMAKE_VERSION} VERSION_LESS "3.9") + cmake_policy(SET CMP0069 NEW) + option(ENABLE_IPO "Enable interprocedural (link time, LTO) optimization" OFF) + if(ENABLE_IPO) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) + endif() +endif() + # # Configuration # |