[Cmake-commits] CMake branch, next, updated. v2.8.7-3108-gb7effdf

David Cole david.cole at kitware.com
Wed Mar 7 16:32:15 EST 2012


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  b7effdfa9c061facd605cd2af4db25fcdfa7f82b (commit)
       via  36d6c60172d6bd8515e2931cd0adfc45aeee6878 (commit)
       via  095e45bbe265ebde29ebba53925fee9a8ce37384 (commit)
       via  277999a4e47a3bc4e2ed0cbbcbd7f156dd3194d9 (commit)
      from  df4918fc7ca76d031c0b728322635df5b7260842 (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=b7effdfa9c061facd605cd2af4db25fcdfa7f82b
commit b7effdfa9c061facd605cd2af4db25fcdfa7f82b
Merge: df4918f 36d6c60
Author:     David Cole <david.cole at kitware.com>
AuthorDate: Wed Mar 7 16:32:05 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Mar 7 16:32:05 2012 -0500

    Merge topic 'ninja-generator' into next
    
    36d6c60 Add friend struct so it can access the private ConvertToNinjaPath.
    095e45b add .def file support
    277999a ensure the output dir exists at compile time


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=36d6c60172d6bd8515e2931cd0adfc45aeee6878
commit 36d6c60172d6bd8515e2931cd0adfc45aeee6878
Author:     David Cole <david.cole at kitware.com>
AuthorDate: Wed Mar 7 16:07:45 2012 -0500
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Wed Mar 7 16:24:34 2012 -0500

    Add friend struct so it can access the private ConvertToNinjaPath.
    
    The HP aCC compiler is apparently more strict than all our other
    dashboard compilers with respect to complaining about this.

diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index 8ef4d28..e9bbf43 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -95,6 +95,8 @@ private:
 
   std::string ConvertToNinjaPath(const char *path);
 
+  struct map_to_ninja_path;
+  friend struct map_to_ninja_path;
   struct map_to_ninja_path {
     cmLocalNinjaGenerator *LocalGenerator;
     map_to_ninja_path(cmLocalNinjaGenerator *LocalGen)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=095e45bbe265ebde29ebba53925fee9a8ce37384
commit 095e45bbe265ebde29ebba53925fee9a8ce37384
Author:     Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Tue Mar 6 23:41:40 2012 +0100
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Wed Mar 7 16:24:34 2012 -0500

    add .def file support

diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 3f8644e..e77252f 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -325,6 +325,8 @@ private:
 
   typedef std::map<std::string, cmTarget*> TargetAliasMap;
   TargetAliasMap TargetAliases;
+
+  static cmLocalGenerator* LocalGenerator;
 };
 
 #endif // ! cmGlobalNinjaGenerator_h
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index aa3286c..3920b89 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1503,7 +1503,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
             linkFlags +=
               this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG");
             linkFlags += this->Convert(sf->GetFullPath().c_str(),
-                                       START_OUTPUT, SHELL);
+                                       FULL, SHELL);
             linkFlags += " ";
             }
           }
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index f4069c7..9e05b4c 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -285,6 +285,7 @@ cmNinjaNormalTargetGenerator
       default:
         assert(0 && "Unexpected target type");
       }
+
       const char *linkCmd =
         this->GetMakefile()->GetRequiredDefinition(linkCmdVar.c_str());
       cmSystemTools::ExpandListArgument(linkCmd, linkCmds);
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index d0b4156..8fa367f 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -229,6 +229,13 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
   const std::vector<std::string> &deps = cli->GetDepends();
   cmNinjaDeps result(deps.size());
   std::transform(deps.begin(), deps.end(), result.begin(), MapToNinjaPath());
+
+  // Add a dependency on the link definitions file, if any.
+  if(!this->ModuleDefinitionFile.empty())
+    {
+    result.push_back(this->ModuleDefinitionFile);
+    }
+
   return result;
 }
 
@@ -328,6 +335,7 @@ cmNinjaTargetGenerator
   }
   vars.Flags = flags.c_str();
 
+
   // Rule for compiling object file.
   std::string compileCmdVar = "CMAKE_";
   compileCmdVar += language;
@@ -395,6 +403,8 @@ cmNinjaTargetGenerator
   if (!language) {
     if (source->GetPropertyAsBool("EXTERNAL_OBJECT"))
       this->Objects.push_back(this->GetSourceFilePath(source));
+    if(cmSystemTools::UpperCase(source->GetExtension()) == "DEF")
+      this->ModuleDefinitionFile = GetSourceFilePath(source);
     return;
   }
 
@@ -465,3 +475,29 @@ cmNinjaTargetGenerator
                                      orderOnlyDeps,
                                      vars);
 }
+
+//----------------------------------------------------------------------------
+void
+cmNinjaTargetGenerator
+::AddModuleDefinitionFlag(std::string& flags)
+{
+  if(this->ModuleDefinitionFile.empty())
+    {
+    return;
+    }
+
+  // TODO: Create a per-language flag variable.
+  const char* defFileFlag =
+    this->Makefile->GetDefinition("CMAKE_LINK_DEF_FILE_FLAG");
+  if(!defFileFlag)
+    {
+    return;
+    }
+
+  // Append the flag and value.  Use ConvertToLinkReference to help
+  // vs6's "cl -link" pass it to the linker.
+  std::string flag = defFileFlag;
+  flag += (this->LocalGenerator->ConvertToLinkReference(
+             this->ModuleDefinitionFile.c_str()));
+  this->LocalGenerator->AppendFlags(flags, flag.c_str());
+}
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index f9270a2..3e70a2c 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -107,12 +107,18 @@ protected:
   cmNinjaDeps GetObjects() const
   { return this->Objects; }
 
+  // Helper to add flag for windows .def file.
+  void AddModuleDefinitionFlag(std::string& flags);
+
 private:
   cmTarget* Target;
   cmMakefile* Makefile;
   cmLocalNinjaGenerator* LocalGenerator;
   /// List of object files for this target.
   cmNinjaDeps Objects;
+
+  // The windows module definition source file (.def), if any.
+  std::string ModuleDefinitionFile;
 };
 
 #endif // ! cmNinjaTargetGenerator_h

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=277999a4e47a3bc4e2ed0cbbcbd7f156dd3194d9
commit 277999a4e47a3bc4e2ed0cbbcbd7f156dd3194d9
Author:     Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Thu Feb 23 19:39:54 2012 +0100
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Wed Mar 7 16:24:33 2012 -0500

    ensure the output dir exists at compile time

diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 88f6f87..f4069c7 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -42,6 +42,11 @@ cmNinjaNormalTargetGenerator(cmTarget* target)
                             this->TargetNameImport,
                             this->TargetNamePDB,
                             GetLocalGenerator()->GetConfigName());
+
+  // on Windows the output dir is already needed at compile time
+  // ensure the directory exists (OutDir test)
+  std::string outpath = target->GetDirectory(this->GetConfigName());
+  cmSystemTools::MakeDirectory(outpath.c_str());
 }
 
 cmNinjaNormalTargetGenerator::~cmNinjaNormalTargetGenerator()

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

Summary of changes:
 Source/cmGlobalNinjaGenerator.h         |    2 +
 Source/cmLocalGenerator.cxx             |    2 +-
 Source/cmLocalNinjaGenerator.h          |    2 +
 Source/cmNinjaNormalTargetGenerator.cxx |    6 +++++
 Source/cmNinjaTargetGenerator.cxx       |   36 +++++++++++++++++++++++++++++++
 Source/cmNinjaTargetGenerator.h         |    6 +++++
 6 files changed, 53 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list