[Cmake-commits] CMake branch, next, updated. v2.8.2-827-g2641df7

Brad King brad.king at kitware.com
Fri Sep 17 10:22:14 EDT 2010


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  2641df7fd438e78afa308400e71a891283552415 (commit)
       via  5f05a3c25e1480648f46c9ccbf775225f9e8e32d (commit)
       via  2d9bb3325f6b1155bc7848f1f666e79c37bfa253 (commit)
      from  553230e4c772f28cfa55a2d3d08317d612229000 (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=2641df7fd438e78afa308400e71a891283552415
commit 2641df7fd438e78afa308400e71a891283552415
Merge: 553230e 5f05a3c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 17 10:22:13 2010 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Sep 17 10:22:13 2010 -0400

    Merge topic 'mingw-long-object-lists' into next
    
    5f05a3c MinGW: Support long object file lists
    2d9bb33 Evaluate <OBJECT_DIR> rule variable for executables


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f05a3c25e1480648f46c9ccbf775225f9e8e32d
commit 5f05a3c25e1480648f46c9ccbf775225f9e8e32d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 17 09:25:36 2010 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 17 09:25:36 2010 -0400

    MinGW: Support long object file lists
    
    Use a combination of response files and the archiver to support long
    object file lists that do not fit in the Windows command-line length
    limit.  This can work only with GCC >= 4 because the MinGW GCC 3.x
    front-ends do not support response-file syntax.

diff --git a/Modules/Platform/Windows-GNU-Fortran.cmake b/Modules/Platform/Windows-GNU-Fortran.cmake
index 8273a19..c66feed 100644
--- a/Modules/Platform/Windows-GNU-Fortran.cmake
+++ b/Modules/Platform/Windows-GNU-Fortran.cmake
@@ -1,3 +1,2 @@
 include(Platform/Windows-GNU)
 __windows_compiler_gnu(Fortran)
-set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 0)
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index 79b2f80..ac635a5 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -76,7 +76,23 @@ macro(__windows_compiler_gnu lang)
 
   set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows
   set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS ${__WINDOWS_GNU_LD_RESPONSE})
-  set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@")
+
+  # We prefer "@" for response files but it is not supported by gcc 3.
+  execute_process(COMMAND ${CMAKE_${lang}_COMPILER} --version OUTPUT_VARIABLE _ver ERROR_VARIABLE _ver)
+  if("${_ver}" MATCHES "\\(GCC\\) 3\\.")
+    if("${lang}" STREQUAL "Fortran")
+      # The GNU Fortran compiler reports an error:
+      #   no input files; unwilling to write output files
+      # when the response file is passed with "-Wl,@".
+      set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 0)
+    else()
+      # Use "-Wl,@" to pass the response file to the linker.
+      set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@")
+    endif()
+  elseif(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS)
+    # Use "@" to pass the response file to the front-end.
+    set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@")
+  endif()
 
   # Binary link rules.
   set(CMAKE_${lang}_CREATE_SHARED_MODULE
@@ -85,4 +101,21 @@ macro(__windows_compiler_gnu lang)
     "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
   set(CMAKE_${lang}_LINK_EXECUTABLE
     "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
+
+  # Support very long lists of object files.
+  if("${CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG}" STREQUAL "@")
+    foreach(rule CREATE_SHARED_MODULE CREATE_SHARED_LIBRARY LINK_EXECUTABLE)
+      # The gcc/collect2/ld toolchain does not use response files
+      # internally so we cannot pass long object lists.  Instead pass
+      # the object file list in a response file to the archiver to put
+      # them in a temporary archive.  Hand the archive to the linker.
+      string(REPLACE "<OBJECTS>" "-Wl,--whole-archive <OBJECT_DIR>/objects.a -Wl,--no-whole-archive"
+        CMAKE_${lang}_${rule} "${CMAKE_${lang}_${rule}}")
+      set(CMAKE_${lang}_${rule}
+        "<CMAKE_COMMAND> -E remove -f <OBJECT_DIR>/objects.a"
+        "<CMAKE_AR> cr <OBJECT_DIR>/objects.a <OBJECTS>"
+        "${CMAKE_${lang}_${rule}}"
+        )
+    endforeach()
+  endif()
 endmacro()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d9bb3325f6b1155bc7848f1f666e79c37bfa253
commit 2d9bb3325f6b1155bc7848f1f666e79c37bfa253
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Sep 16 15:07:41 2010 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 16 15:07:41 2010 -0400

    Evaluate <OBJECT_DIR> rule variable for executables
    
    Previously this placeholder was evaluated only for libraries.  Make it
    work for executables too.

diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 93c981a..a5e319d 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -345,6 +345,13 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   vars.CMTarget = this->Target;
   vars.Language = linkLanguage;
   vars.Objects = buildObjs.c_str();
+  std::string objdir = cmake::GetCMakeFilesDirectoryPostSlash();
+  objdir += this->Target->GetName();
+  objdir += ".dir";
+  objdir = this->Convert(objdir.c_str(),
+                         cmLocalGenerator::START_OUTPUT,
+                         cmLocalGenerator::SHELL);
+  vars.ObjectDir = objdir.c_str();
   vars.Target = targetOutPathReal.c_str();
   vars.TargetPDB = targetOutPathPDB.c_str();
 

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

Summary of changes:
 Modules/Platform/Windows-GNU-Fortran.cmake     |    1 -
 Modules/Platform/Windows-GNU.cmake             |   35 +++++++++++++++++++++++-
 Source/cmMakefileExecutableTargetGenerator.cxx |    7 +++++
 3 files changed, 41 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list