[Cmake-commits] CMake branch, next, updated. v2.8.12.2-7466-g4235aa0

Nils Gladitz nilsgladitz at gmail.com
Thu Feb 6 10:12:41 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  4235aa09c5a1e6f4ef12b5ee5dc76e2f2b0aa78c (commit)
       via  6c755f0bf995e157e14e442d439d1778769f7014 (commit)
      from  55d6db540d54784565ddd2914c8451c8212a048a (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=4235aa09c5a1e6f4ef12b5ee5dc76e2f2b0aa78c
commit 4235aa09c5a1e6f4ef12b5ee5dc76e2f2b0aa78c
Merge: 55d6db5 6c755f0
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Thu Feb 6 10:12:40 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Feb 6 10:12:40 2014 -0500

    Merge topic 'gcc-ipo' into next
    
    6c755f0b IPO: involve the linker to more reliably check for gcc LTO support


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c755f0bf995e157e14e442d439d1778769f7014
commit 6c755f0bf995e157e14e442d439d1778769f7014
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Thu Feb 6 16:11:10 2014 +0100
Commit:     Nils Gladitz <nilsgladitz at gmail.com>
CommitDate: Thu Feb 6 16:11:10 2014 +0100

    IPO: involve the linker to more reliably check for gcc LTO support

diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 2208a06..c135ec3 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -76,32 +76,33 @@ macro(__compiler_gnu lang)
   endif()
 
   if(CMAKE_GCC_AR AND CMAKE_GCC_RANLIB)
-    if(NOT DEFINED CMAKE_${lang}_HAS_COLLECT_LTO_WRAPPER)
+    set(__lto_flags -flto)
+
+    if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.7)
+      list(APPEND __lto_flags -fno-fat-lto-objects)
+    endif()
+
+    if(NOT DEFINED CMAKE_${lang}_PASSED_LTO_TEST)
       execute_process(
-        COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_VERBOSE_FLAG}
+        COMMAND ${CMAKE_COMMAND} -E echo "int main() {}"
+        COMMAND ${CMAKE_${lang}_COMPILER} ${__lto_flags} -xc -
+          -o ${CMAKE_PLATFORM_INFO_DIR}/lto-test-${lang}
         RESULT_VARIABLE __result
-        ERROR_VARIABLE __output
+        ERROR_QUIET
         OUTPUT_QUIET
       )
 
       set(__lto_found FALSE)
-      if("${__result}" STREQUAL "0" AND
-        "${__output}" MATCHES "COLLECT_LTO_WRAPPER")
-
+      if("${__result}" STREQUAL "0")
         set(__lto_found TRUE)
       endif()
 
-      set(CMAKE_${lang}_HAS_COLLECT_LTO_WRAPPER
+      set(CMAKE_${lang}_PASSED_LTO_TEST
         ${__lto_found} CACHE INTERNAL
-        "If the output of gcc -v contains COLLECT_LTO_WRAPPER")
+        "If the compiler passed a simple LTO test compile")
     endif()
 
-    if(CMAKE_${lang}_HAS_COLLECT_LTO_WRAPPER)
-      set(__lto_flags -flto)
-
-      if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.7)
-        list(APPEND __lto_flags -fno-fat-lto-objects)
-      endif()
+    if(CMAKE_${lang}_PASSED_LTO_TEST)
 
       set(CMAKE_${lang}_COMPILE_OPTIONS_IPO ${__lto_flags})
 

-----------------------------------------------------------------------

Summary of changes:
 Modules/Compiler/GNU.cmake |   29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list