[Cmake-commits] CMake branch, next, updated. v2.8.4-1213-g9104550

Brad King brad.king at kitware.com
Fri Mar 18 09:30:21 EDT 2011


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  9104550e3d18265dec62c454da46605d7aa9be8f (commit)
       via  86cb17b18de78e178b76e9be471789084994a162 (commit)
       via  9a0b9bc8b756bcb027485d72fb9619c8e10f5a0a (commit)
       via  6e8a67f99a34f2166ee838eb68968ae200830cac (commit)
       via  d099546450a9c9ce12763cab1af182b2d98ebba6 (commit)
      from  02f43cb3a31fe8cc6841217bdc0bac75e365177c (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=9104550e3d18265dec62c454da46605d7aa9be8f
commit 9104550e3d18265dec62c454da46605d7aa9be8f
Merge: 02f43cb 86cb17b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 18 09:30:18 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Mar 18 09:30:18 2011 -0400

    Merge topic 'include-flags-response-file' into next
    
    86cb17b Pass include directories with response files to GNU on Windows
    9a0b9bc Optionally pass include directories with response files
    6e8a67f Generate target-wide flags before individual build rules
    d099546 Factor old-style -D flags out from -I flag generation


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86cb17b18de78e178b76e9be471789084994a162
commit 86cb17b18de78e178b76e9be471789084994a162
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Mar 17 15:44:57 2011 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Mar 17 17:56:14 2011 -0400

    Pass include directories with response files to GNU on Windows
    
    The GNU 4.x toolchain on MinGW (and therefore MSYS) allows compiler
    options to be passed via response files.  Use this to pass include
    directory -I options.  This allows the include file search path to be
    very long despite shell and mingw32-make command line length limits.

diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index 7084b83..271236c 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -78,6 +78,7 @@ 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}_USE_RESPONSE_FILE_FOR_INCLUDES 1)
 
   # 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)
@@ -91,6 +92,8 @@ macro(__windows_compiler_gnu lang)
       # Use "-Wl,@" to pass the response file to the linker.
       set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@")
     endif()
+    # The GNU 3.x compilers do not support response files (only linkers).
+    set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 0)
   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 "@")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a0b9bc8b756bcb027485d72fb9619c8e10f5a0a
commit 9a0b9bc8b756bcb027485d72fb9619c8e10f5a0a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 15 14:07:36 2011 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Mar 17 17:56:13 2011 -0400

    Optionally pass include directories with response files
    
    Create platform option CMAKE_<lang>_USE_RESPONSE_FILE_FOR_INCLUDES to
    enable use of response files for passing the list of include directories
    to compiler command lines.

diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 0cd5fa2..14a1062 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1451,6 +1451,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
                      cmProperty::VARIABLE,0,0);
   cm->DefineProperty("CMAKE_<LANG>_STANDARD_LIBRARIES_INIT",
                      cmProperty::VARIABLE,0,0);
+  cm->DefineProperty("CMAKE_<LANG>_USE_RESPONSE_FILE_FOR_INCLUDES",
+                     cmProperty::VARIABLE,0,0);
   cm->DefineProperty("CMAKE_<LANG>_USE_RESPONSE_FILE_FOR_OBJECTS",
                      cmProperty::VARIABLE,0,0);
   cm->DefineProperty("CMAKE_EXECUTABLE_SUFFIX_<LANG>",
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 29853e5..7da35eb 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1185,15 +1185,18 @@ cmLocalGenerator::ConvertToOutputForExisting(RelativeRoot remote,
 }
 
 //----------------------------------------------------------------------------
-const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
+const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
+                                              bool forResponseFile)
 {
   if(!lang)
     {
     return "";
     }
-  if(this->LanguageToIncludeFlags.count(lang))
+  std::string key = lang;
+  key += forResponseFile? "@" : "";
+  if(this->LanguageToIncludeFlags.count(key))
     {
-    return this->LanguageToIncludeFlags[lang].c_str();
+    return this->LanguageToIncludeFlags[key].c_str();
     }
 
   cmOStringStream includeFlags;
@@ -1251,10 +1254,10 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
       frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str());
       if(emitted.insert(frameworkDir).second)
         {
+        OutputFormat format = forResponseFile? RESPONSE : SHELL;
         includeFlags
           << "-F" << this->Convert(frameworkDir.c_str(),
-                                   cmLocalGenerator::START_OUTPUT,
-                                   cmLocalGenerator::SHELL, true)
+                                   START_OUTPUT, format, true)
           << " ";
         }
       continue;
@@ -1274,7 +1277,16 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
         }
       flagUsed = true;
       }
-    std::string includePath = this->ConvertToOutputForExisting(i->c_str());
+    std::string includePath;
+    if(forResponseFile)
+      {
+      includePath = this->Convert(i->c_str(), START_OUTPUT,
+                                  RESPONSE, true);
+      }
+    else
+      {
+      includePath = this->ConvertToOutputForExisting(i->c_str());
+      }
     if(quotePaths && includePath.size() && includePath[0] != '\"')
       {
       includeFlags << "\"";
@@ -1292,11 +1304,11 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
     {
     flags[flags.size()-1] = ' ';
     }
-  this->LanguageToIncludeFlags[lang] = flags;
+  this->LanguageToIncludeFlags[key] = flags;
 
   // Use this temorary variable for the return value to work-around a
   // bogus GCC 2.95 warning.
-  const char* ret = this->LanguageToIncludeFlags[lang].c_str();
+  const char* ret = this->LanguageToIncludeFlags[key].c_str();
   return ret;
 }
 
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 35aab99..aebf9f3 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -143,7 +143,8 @@ public:
                               const char* config);
   virtual void AppendFlags(std::string& flags, const char* newFlags);
   ///! Get the include flags for the current makefile and language
-  const char* GetIncludeFlags(const char* lang); 
+  const char* GetIncludeFlags(const char* lang,
+                              bool forResponseFile = false);
 
   /**
    * Encode a list of preprocessor definitions for the compiler
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index ff48009..d1214d2 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -883,6 +883,20 @@ cmLocalUnixMakefileGenerator3
 //----------------------------------------------------------------------------
 void
 cmLocalUnixMakefileGenerator3
+::AppendRuleDepends(std::vector<std::string>& depends,
+                    std::vector<std::string> const& ruleFiles)
+{
+  // Add a dependency on the rule file itself unless an option to skip
+  // it is specifically enabled by the user or project.
+  if(!this->Makefile->IsOn("CMAKE_SKIP_RULE_DEPENDENCY"))
+    {
+    depends.insert(depends.end(), ruleFiles.begin(), ruleFiles.end());
+    }
+}
+
+//----------------------------------------------------------------------------
+void
+cmLocalUnixMakefileGenerator3
 ::AppendCustomDepends(std::vector<std::string>& depends,
                       const std::vector<cmCustomCommand>& ccs)
 {
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 790eff1..9ff6e5e 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -320,6 +320,8 @@ protected:
 
   void AppendRuleDepend(std::vector<std::string>& depends,
                         const char* ruleFileName);
+  void AppendRuleDepends(std::vector<std::string>& depends,
+                         std::vector<std::string> const& ruleFiles);
   void AppendCustomDepends(std::vector<std::string>& depends,
                            const std::vector<cmCustomCommand>& ccs);
   void AppendCustomDepend(std::vector<std::string>& depends,
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index a6f7777..69320da 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -310,8 +310,7 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
     this->LocalGenerator->AddSharedFlags(flags, lang, shared);
 
     // Add include directory flags.
-    this->LocalGenerator->
-      AppendFlags(flags, this->LocalGenerator->GetIncludeFlags(lang));
+    this->AddIncludeFlags(flags, lang);
 
     // Append old-style preprocessor definition flags.
     this->LocalGenerator->
@@ -487,6 +486,8 @@ cmMakefileTargetGenerator
 {
   this->LocalGenerator->AppendRuleDepend(depends,
                                          this->FlagFileNameFull.c_str());
+  this->LocalGenerator->AppendRuleDepends(depends,
+                                          this->FlagFileDepends[lang]);
 
   // generate the depend scanning rule
   this->WriteObjectDependRules(source, depends);
@@ -1725,6 +1726,38 @@ cmMakefileTargetGenerator
 }
 
 //----------------------------------------------------------------------------
+void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
+                                                const char* lang)
+{
+  std::string responseVar = "CMAKE_";
+  responseVar += lang;
+  responseVar += "_USE_RESPONSE_FILE_FOR_INCLUDES";
+  bool useResponseFile = this->Makefile->IsOn(responseVar.c_str());
+
+  std::string includeFlags =
+    this->LocalGenerator->GetIncludeFlags(lang, useResponseFile);
+  if(includeFlags.empty())
+    {
+    return;
+    }
+
+  if(useResponseFile)
+    {
+    std::string name = "includes_";
+    name += lang;
+    name += ".rsp";
+    std::string arg = "@" +
+      this->CreateResponseFile(name.c_str(), includeFlags,
+                               this->FlagFileDepends[lang]);
+    this->LocalGenerator->AppendFlags(flags, arg.c_str());
+    }
+  else
+    {
+    this->LocalGenerator->AppendFlags(flags, includeFlags.c_str());
+    }
+}
+
+//----------------------------------------------------------------------------
 const char* cmMakefileTargetGenerator::GetFortranModuleDirectory()
 {
   // Compute the module directory.
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index c9aede2..bd26795 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -146,6 +146,8 @@ protected:
                          bool useResponseFile, std::string& buildObjs,
                          std::vector<std::string>& makefile_depends);
 
+  void AddIncludeFlags(std::string& flags, const char* lang);
+
   virtual void CloseFileStreams();
   void RemoveForbiddenFlags(const char* flagVar, const char* linkLang,
                             std::string& linkFlags);
@@ -177,6 +179,8 @@ protected:
   // the stream for the flag file
   std::string FlagFileNameFull;
   cmGeneratedFileStream *FlagFileStream;
+  class StringList: public std::vector<std::string> {};
+  std::map<cmStdString, StringList> FlagFileDepends;
 
   // the stream for the info file
   std::string InfoFileNameFull;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e8a67f99a34f2166ee838eb68968ae200830cac
commit 6e8a67f99a34f2166ee838eb68968ae200830cac
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 15 13:31:42 2011 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Mar 17 15:21:59 2011 -0400

    Generate target-wide flags before individual build rules
    
    This switches the internal generation order but does not affect the
    results.  The new order ensures that any internal state changed by
    generating target-wide flags is known when the individual rules that use
    those flags are generated.

diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 4426241..cd75d79 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -47,12 +47,12 @@ void cmMakefileExecutableTargetGenerator::WriteRuleFiles()
   // write rules used to help build object files
   this->WriteCommonCodeRules();
 
-  // write in rules for object files and custom commands
-  this->WriteTargetBuildRules();
-
   // write the per-target per-language flags
   this->WriteTargetLanguageFlags();
 
+  // write in rules for object files and custom commands
+  this->WriteTargetBuildRules();
+
   // write the link rules
   this->WriteExecutableRule(false);
   if(this->Target->NeedRelinkBeforeInstall(this->ConfigName))
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 049a338..c5900f1 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -52,12 +52,12 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
   // write rules used to help build object files
   this->WriteCommonCodeRules();
 
-  // write in rules for object files and custom commands
-  this->WriteTargetBuildRules();
-
   // write the per-target per-language flags
   this->WriteTargetLanguageFlags();
 
+  // write in rules for object files and custom commands
+  this->WriteTargetBuildRules();
+
   // write the link rules
   // Write the rule for this target type.
   switch(this->Target->GetType())

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d099546450a9c9ce12763cab1af182b2d98ebba6
commit d099546450a9c9ce12763cab1af182b2d98ebba6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 15 13:09:06 2011 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Mar 15 13:09:06 2011 -0400

    Factor old-style -D flags out from -I flag generation
    
    Move the GetDefineFlags call from cmLocalGenerator::GetIncludeFlags to
    all call sites so that the method exclusively constructs a string of
    include search path flags.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index d3cbc1f..29853e5 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -575,6 +575,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
   flags += this->Makefile->GetSafeDefinition(varString.c_str());
   flags += " ";
   flags += this->GetIncludeFlags(lang);
+  flags += this->Makefile->GetDefineFlags();
 
   // Construct the command lines.
   cmCustomCommandLines commandLines;
@@ -1291,8 +1292,6 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
     {
     flags[flags.size()-1] = ' ';
     }
-  std::string defineFlags = this->Makefile->GetDefineFlags();
-  flags += defineFlags;
   this->LanguageToIncludeFlags[lang] = flags;
 
   // Use this temorary variable for the return value to work-around a
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 9dcd8f1..a6f7777 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -312,6 +312,11 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
     // Add include directory flags.
     this->LocalGenerator->
       AppendFlags(flags, this->LocalGenerator->GetIncludeFlags(lang));
+
+    // Append old-style preprocessor definition flags.
+    this->LocalGenerator->
+      AppendFlags(flags, this->Makefile->GetDefineFlags());
+
     // Add include directory flags.
     this->LocalGenerator->
       AppendFlags(flags,this->GetFrameworkFlags().c_str());

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

Summary of changes:
 Modules/Platform/Windows-GNU.cmake             |    3 ++
 Source/cmDocumentVariables.cxx                 |    2 +
 Source/cmLocalGenerator.cxx                    |   31 ++++++++++++------
 Source/cmLocalGenerator.h                      |    3 +-
 Source/cmLocalUnixMakefileGenerator3.cxx       |   14 ++++++++
 Source/cmLocalUnixMakefileGenerator3.h         |    2 +
 Source/cmMakefileExecutableTargetGenerator.cxx |    6 ++--
 Source/cmMakefileLibraryTargetGenerator.cxx    |    6 ++--
 Source/cmMakefileTargetGenerator.cxx           |   40 +++++++++++++++++++++++-
 Source/cmMakefileTargetGenerator.h             |    4 ++
 10 files changed, 93 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list