diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2021-05-23 19:44:07 +0100 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-05-24 15:58:16 +0000 |
commit | f273c62553636640242b0c76ac3de99e9e93d626 (patch) | |
tree | d80f4ab23b0eeaa04f6f3cc8cc0636721c1f6c6b | |
parent | 54e6b249c116c65289d2a248b558d359b23db75f (diff) |
CMake: Enable LTO/IPO support for all platforms
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | CMakeOptions.txt | 7 |
2 files changed, 10 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cedd88244..cd6209f4dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,17 +70,16 @@ message(STATUS "Generating build using CMake ${CMAKE_VERSION}") #Where to find local cmake scripts set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) -# CMake >= 3.9.0 enables LTO/IPO -# Policy CMP0069 enables this behavior when we set the minimum CMake version < 3.9.0 +# CMake >= 3.9.0 supports LTO/IPO. if (ENABLE_LTO) include(CheckIPOSupported) - check_ipo_supported(RESULT lto_supported) + check_ipo_supported(RESULT lto_supported OUTPUT lto_output) if(lto_supported) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + message(STATUS "LTO/IPO is enabled") + else() + message(STATUS "LTO/IPO requested but it is not supported by the compiler: ${lto_output}") endif() -endif() -if (CMAKE_INTERPROCEDURAL_OPTIMIZATION) - message(STATUS "LTO/IPO is enabled") else() message(STATUS "LTO/IPO is not enabled") endif() diff --git a/CMakeOptions.txt b/CMakeOptions.txt index 9db67cc54c..6bf4ad0cf4 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -63,13 +63,16 @@ else() option(ENABLE_COMPILER_COLOR_DIAGNOSTICS "Always enable the compiler's color diagnostic output" OFF) endif() -if (WIN32) +if(CMAKE_VERSION VERSION_GREATER "3.8.99") option(ENABLE_LTO "Improves performance using Link time Optimization" ON) - option(ENABLE_VLD "Enable Visual Leak Detect in Debug configuration" OFF) else() option(ENABLE_LTO "Improves performance using Link time Optimization" OFF) endif() +if (WIN32) + option(ENABLE_VLD "Enable Visual Leak Detect in Debug configuration" OFF) +endif() + option(ENABLE_PCAP "Enable libpcap support (required for capturing)" ON) # # AirPcap support is available only on Windows. It might be nice to have it |