This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch jd_lto
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit cd8567621a083f104ed060eb4ef9d71e85fe9993
Author: Jiri DanÄ›k <[email protected]>
AuthorDate: Fri Feb 11 18:01:44 2022 +0100

    DO NOT MERGE try what lto does; this needs cmake 3.9 so it will break in 
places, but I want to see what happens
---
 CMakeLists.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 914aaf6..7e46b35 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,6 +90,16 @@ include(CheckSymbolExists)
 include(CheckFunctionExists)
 include(CheckIncludeFiles)
 include(CMakeDependentOption)
+include(CheckIPOSupported)
+
+check_ipo_supported(RESULT cc_has_ipo OUTPUT check_ipo_supported_output)
+message(STATUS "Interprocedural optimization (IPO/LTO) supported: 
${cc_has_ipo}")
+if(NOT cc_has_ipo)
+    message(WARNING "IPO is not supported: ${output}")
+endif()
+if(NOT DEFINED(CMAKE_INTERPROCEDURAL_OPTIMIZATION))
+    set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ${cc_has_ipo})
+endif()
 
 ##
 ## Find dependencies

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to