[Cmake-commits] CMake branch, next, updated. v2.8.12.2-7409-g4682795
Nils Gladitz
nilsgladitz at gmail.com
Tue Feb 4 10:55:12 EST 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 468279520fae07a9b07c47476ed7080ac2c1d20a (commit)
via 5f6d023d5a14e006c94c62b4a8c3185769e309b3 (commit)
from b503c41c5750abc9dc3216fc9dea07b9e44eb428 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=468279520fae07a9b07c47476ed7080ac2c1d20a
commit 468279520fae07a9b07c47476ed7080ac2c1d20a
Merge: b503c41 5f6d023
Author: Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Tue Feb 4 10:55:11 2014 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Feb 4 10:55:11 2014 -0500
Merge topic 'gcc-ipo' into next
5f6d023d IPO: check if the compiler was compiled with lto support
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f6d023d5a14e006c94c62b4a8c3185769e309b3
commit 5f6d023d5a14e006c94c62b4a8c3185769e309b3
Author: Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Tue Feb 4 16:31:37 2014 +0100
Commit: Nils Gladitz <nilsgladitz at gmail.com>
CommitDate: Tue Feb 4 16:33:24 2014 +0100
IPO: check if the compiler was compiled with lto support
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 59909c1..6bd0ba0 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -76,18 +76,34 @@ macro(__compiler_gnu lang)
endif()
if(CMAKE_GCC_AR AND CMAKE_GCC_RANLIB)
- set(CMAKE_${lang}_COMPILE_OPTIONS_IPO -flto -fno-fat-lto-objects)
+ if(NOT DEFINED CMAKE_${lang}_HAS_COLLECT_LTO_WRAPPER)
+ execute_process(COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_VERBOSE_FLAG}
+ RESULT_VARIABLE __result
+ ERROR_VARIABLE __output
+ OUTPUT_QUIET
+ )
+
+ set(__lto_found FALSE)
+ if("${__result}" STREQUAL "0" AND "${__output}" MATCHES "COLLECT_LTO_WRAPPER")
+ set(__lto_found TRUE)
+ endif()
+ set(CMAKE_${lang}_HAS_COLLECT_LTO_WRAPPER ${__lto_found} CACHE INTERNAL "")
+ endif()
+
+ if(CMAKE_${lang}_HAS_COLLECT_LTO_WRAPPER)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_IPO -flto -fno-fat-lto-objects)
- set(CMAKE_${lang}_ARCHIVE_CREATE_IPO
- "${CMAKE_GCC_AR} cr <TARGET> <LINK_FLAGS> <OBJECTS>"
- )
+ set(CMAKE_${lang}_ARCHIVE_CREATE_IPO
+ "${CMAKE_GCC_AR} cr <TARGET> <LINK_FLAGS> <OBJECTS>"
+ )
- set(CMAKE_${lang}_ARCHIVE_APPEND_IPO
- "${CMAKE_GCC_AR} r <TARGET> <LINK_FLAGS> <OBJECTS>"
- )
+ set(CMAKE_${lang}_ARCHIVE_APPEND_IPO
+ "${CMAKE_GCC_AR} r <TARGET> <LINK_FLAGS> <OBJECTS>"
+ )
- set(CMAKE_${lang}_ARCHIVE_FINISH_IPO
- "${CMAKE_GCC_RANLIB} <TARGET>"
- )
+ set(CMAKE_${lang}_ARCHIVE_FINISH_IPO
+ "${CMAKE_GCC_RANLIB} <TARGET>"
+ )
+ endif()
endif()
endmacro()
-----------------------------------------------------------------------
Summary of changes:
Modules/Compiler/GNU.cmake | 36 ++++++++++++++++++++++++++----------
1 file changed, 26 insertions(+), 10 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list