[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2737-gf0d05cc

Robert Maynard robert.maynard at kitware.com
Tue Apr 9 10:02:18 EDT 2013


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  f0d05cca10091f7f288d77c7fa861a9f86e37ba7 (commit)
       via  1aa23205e683995d2ae5b2da0109c93a7c3030e9 (commit)
      from  810542d9664dc3b5be1988c8fb1b926a6c9db529 (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=f0d05cca10091f7f288d77c7fa861a9f86e37ba7
commit f0d05cca10091f7f288d77c7fa861a9f86e37ba7
Merge: 810542d 1aa2320
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Tue Apr 9 10:02:17 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 9 10:02:17 2013 -0400

    Merge topic 'ninja_phony_file_targets' into next
    
    1aa2320 Correct spelling, and minor logic issues.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1aa23205e683995d2ae5b2da0109c93a7c3030e9
commit 1aa23205e683995d2ae5b2da0109c93a7c3030e9
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Fri Apr 5 15:26:57 2013 -0400
Commit:     Robert Maynard <robert.maynard at kitware.com>
CommitDate: Fri Apr 5 15:26:57 2013 -0400

    Correct spelling, and minor logic issues.

diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 4bf279b..29045a9 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -264,7 +264,7 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command,
 //
 for(cmNinjaDeps::const_iterator i=deps.begin(); i != deps.end(); ++i)
   {
-  this->UnkownCustomCommandFileDependencies.insert(*i);
+  this->UnknownCustomCommandFileDependencies.insert(*i);
   }
 }
 
@@ -485,7 +485,7 @@ void cmGlobalNinjaGenerator::Generate()
 
   this->WriteAssumedSourceDependencies();
   this->WriteTargetAliases(*this->BuildFileStream);
-  this->WriteUnkownCustomDependencies(*this->BuildFileStream);
+  this->WriteUnknownCustomDependencies(*this->BuildFileStream);
   this->WriteBuiltinTargets(*this->BuildFileStream);
 
   if (cmSystemTools::GetErrorOccuredFlag()) {
@@ -909,40 +909,54 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
   }
 }
 
-void cmGlobalNinjaGenerator::WriteUnkownCustomDependencies(std::ostream& os)
+void cmGlobalNinjaGenerator::WriteUnknownCustomDependencies(std::ostream& os)
 {
-  //Know write out the unknown dependencies. Don't write out any
+  //now write out the unknown dependencies. Don't write out any
   //of these that are now have been added as a known output, file
   //dependency or alias
   cmGlobalNinjaGenerator::WriteDivider(os);
-  os << "#Unkown Build Time  Dependencies.\n\n";
+  os << "# Unknown Build Time Dependencies."
+     << "# Tell Ninja that they may appear as side effects of build rules"
+     << "# otherwise ordered by order-only dependencies.\n\n";
 
-  const std::string rootBuildDirectory =
+  std::string const rootBuildDirectory =
       this->GetCMakeInstance()->GetHomeOutputDirectory();
 
   //remove the following possible targets that we know
   //are false positives
-  UnkownCustomCommandFileDependencies.erase("all");
+  UnknownCustomCommandFileDependencies.erase("all");
+
+  //get the list of files that cmake itself has generated as a
+  //product of configuration.
+  std::set<std::string> configuredFiles;
+  for (std::vector<cmLocalGenerator *>::const_iterator i =
+       this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i)
+    {
+    const std::vector<std::string>& of = (*i)->GetMakefile()->GetOutputFiles();
+    configuredFiles.insert(of.begin(), of.end());
+    }
 
   typedef std::set<std::string>::const_iterator uccfd_iterator;
-  for (uccfd_iterator i = UnkownCustomCommandFileDependencies.begin();
-       i != UnkownCustomCommandFileDependencies.end(); ++i)
+  for (uccfd_iterator i = UnknownCustomCommandFileDependencies.begin();
+       i != UnknownCustomCommandFileDependencies.end(); ++i)
     {
-    bool isUnkown = ( this->CustomCommandOutputs.find(*i) ==
+    bool isUnknown = ( this->CustomCommandOutputs.find(*i) ==
                       this->CustomCommandOutputs.end() );
-    isUnkown = isUnkown && ( this->CustomCommandFileDependencies.find(*i) ==
-                         this->CustomCommandFileDependencies.end() );
-    isUnkown = isUnkown && this->TargetAliases.count(*i) == 0;
+    isUnknown = isUnknown && configuredFiles.count(*i) == 0;
+    isUnknown = isUnknown && this->TargetAliases.count(*i) == 0;
 
-    if(!isUnkown)
+    if(!isUnknown)
     {
       continue;
     }
 
     //verify the file is in the build directory
-    const std::string absDepPath = cmSystemTools::CollapseFullPath(
+
+    std::string const absDepPath = cmSystemTools::CollapseFullPath(
                                      i->c_str(), rootBuildDirectory.c_str());
-    if(absDepPath.find(rootBuildDirectory) == 0)
+    bool const inBuildDir = cmSystemTools::IsSubDirectory(absDepPath.c_str(),
+                                                  rootBuildDirectory.c_str());
+    if(inBuildDir)
       {
       cmNinjaDeps deps(1,*i);
       cmGlobalNinjaGenerator::WritePhonyBuild(os,
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 2954151..0f4c7e6 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -320,7 +320,7 @@ private:
   void WriteAssumedSourceDependencies();
 
   void WriteTargetAliases(std::ostream& os);
-  void WriteUnkownCustomDependencies(std::ostream& os);
+  void WriteUnknownCustomDependencies(std::ostream& os);
 
   void WriteBuiltinTargets(std::ostream& os);
   void WriteTargetAll(std::ostream& os);
@@ -358,13 +358,10 @@ private:
   /// The set of custom command outputs we have seen.
   std::set<std::string> CustomCommandOutputs;
 
-  /// the set of custom command files dependencies we have seen.
-  std::set<std::string> CustomCommandFileDependencies;
-
   /// the set of custom command files dependencies that we haven't
   /// been able to find ownership of. These are presumed to be
   /// created as a side effect of some custom command
-  std::set<std::string> UnkownCustomCommandFileDependencies;
+  std::set<std::string> UnknownCustomCommandFileDependencies;
 
   /// The mapping from source file to assumed dependencies.
   std::map<std::string, std::set<std::string> > AssumedSourceDependencies;

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

Summary of changes:
 Source/cmGlobalNinjaGenerator.cxx |   46 ++++++++++++++++++++++++-------------
 Source/cmGlobalNinjaGenerator.h   |    7 +----
 2 files changed, 32 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list