[Cmake-commits] CMake branch, next, updated. v2.8.12.2-7426-gd5b3a28

Nils Gladitz nilsgladitz at gmail.com
Wed Feb 5 03:12:40 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  d5b3a2843b4222e26579c46c8d064107cbdabe9e (commit)
       via  58d284d01cd4eff7f148cd2df6abd8ad54208627 (commit)
      from  76f39c1886b24a5beed89b6abc22c98c8eec90bd (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=d5b3a2843b4222e26579c46c8d064107cbdabe9e
commit d5b3a2843b4222e26579c46c8d064107cbdabe9e
Merge: 76f39c1 58d284d
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Wed Feb 5 03:12:39 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 5 03:12:39 2014 -0500

    Merge topic 'gcc-ipo' into next
    
    58d284d0 IPO: gcc 4.7 is required for -fno-fat-lto-objects


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=58d284d01cd4eff7f148cd2df6abd8ad54208627
commit 58d284d01cd4eff7f148cd2df6abd8ad54208627
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Wed Feb 5 09:06:29 2014 +0100
Commit:     Nils Gladitz <nilsgladitz at gmail.com>
CommitDate: Wed Feb 5 09:06:29 2014 +0100

    IPO: gcc 4.7 is required for -fno-fat-lto-objects

diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 6bd0ba0..2208a06 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -77,21 +77,33 @@ macro(__compiler_gnu lang)
 
   if(CMAKE_GCC_AR AND CMAKE_GCC_RANLIB)
     if(NOT DEFINED CMAKE_${lang}_HAS_COLLECT_LTO_WRAPPER)
-      execute_process(COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_VERBOSE_FLAG}
+      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")
+      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 "")
+
+      set(CMAKE_${lang}_HAS_COLLECT_LTO_WRAPPER
+        ${__lto_found} CACHE INTERNAL
+        "If the output of gcc -v contains COLLECT_LTO_WRAPPER")
     endif()
 
     if(CMAKE_${lang}_HAS_COLLECT_LTO_WRAPPER)
-      set(CMAKE_${lang}_COMPILE_OPTIONS_IPO -flto -fno-fat-lto-objects)
+      set(__lto_flags -flto)
+
+      if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.7)
+        list(APPEND __lto_flags -fno-fat-lto-objects)
+      endif()
+
+      set(CMAKE_${lang}_COMPILE_OPTIONS_IPO ${__lto_flags})
 
       set(CMAKE_${lang}_ARCHIVE_CREATE_IPO
         "${CMAKE_GCC_AR} cr <TARGET> <LINK_FLAGS> <OBJECTS>"

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

Summary of changes:
 Modules/Compiler/GNU.cmake |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list