[Cmake-commits] CMake branch, next, updated. v3.1.0-rc2-786-g6ce5832

Zack Galbreath zack.galbreath at kitware.com
Fri Nov 21 13:34:33 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  6ce58326b3e4333e531774b6a565e339e2864037 (commit)
       via  17b0fe03052bcbc45293139d408e008371f1ffe0 (commit)
      from  50ab6ce2b58db2326542fcc4aa5f5f2f265394da (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=6ce58326b3e4333e531774b6a565e339e2864037
commit 6ce58326b3e4333e531774b6a565e339e2864037
Merge: 50ab6ce 17b0fe0
Author:     Zack Galbreath <zack.galbreath at kitware.com>
AuthorDate: Fri Nov 21 13:34:32 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Nov 21 13:34:32 2014 -0500

    Merge topic 'fortran-linker-flags' into next
    
    17b0fe03 Fix incremental linking setting for Fortran + VS


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=17b0fe03052bcbc45293139d408e008371f1ffe0
commit 17b0fe03052bcbc45293139d408e008371f1ffe0
Author:     Zack Galbreath <zack.galbreath at kitware.com>
AuthorDate: Fri Nov 14 13:47:00 2014 -0500
Commit:     Zack Galbreath <zack.galbreath at kitware.com>
CommitDate: Fri Nov 21 13:32:45 2014 -0500

    Fix incremental linking setting for Fortran + VS
    
    This commit fixes a bug where it was impossible to specify
    /INCREMENTAL to Fortran projects built with Visual Studio.
    
    The problem was due to the fact that .vfproj files expect
    the value of this flag to be "linkIncremental{No,Yes},
    whereas .vcproj files expect this value to be 0, 1, or 2.
    
    The implementation of this fix adds a new data structure for
    Visual Studio linker flags specific to Fortran.  This can
    easily be extended in the future if more such discrepencies
    between C/C++ and Fortran linking are discovered.

diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index eb45423..0e66764 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -592,6 +592,15 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] =
   {0,0,0,0,0}
 };
 
+cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranLinkFlagTable[] =
+{
+  {"LinkIncremental", "INCREMENTAL:NO", "link incremental",
+   "linkIncrementalNo", 0},
+  {"LinkIncremental", "INCREMENTAL:YES", "link incremental",
+   "linkIncrementalYes", 0},
+  {0,0,0,0,0}
+};
+
 //----------------------------------------------------------------------------
 // Helper class to write build event <Tool .../> elements.
 class cmLocalVisualStudio7Generator::EventWriter
@@ -1056,8 +1065,13 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     extraLinkOptions += " ";
     extraLinkOptions += targetLinkFlags;
     }
-  Options linkOptions(this, Options::Linker,
-                      cmLocalVisualStudio7GeneratorLinkFlagTable);
+  Options linkOptions(this, Options::Linker);
+  if(this->FortranProject)
+    {
+    linkOptions.AddTable(cmLocalVisualStudio7GeneratorFortranLinkFlagTable);
+    }
+  linkOptions.AddTable(cmLocalVisualStudio7GeneratorLinkFlagTable);
+
   linkOptions.Parse(extraLinkOptions.c_str());
   if(!this->ModuleDefinitionFile.empty())
     {
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index cdc8879..00386f6 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -28,6 +28,26 @@ std::string cmVisualStudioGeneratorOptionsEscapeForXML(std::string ret)
 cmVisualStudioGeneratorOptions
 ::cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg,
                                  Tool tool,
+                                 cmVisualStudio10TargetGenerator* g):
+  cmIDEOptions(),
+  LocalGenerator(lg), Version(lg->GetVersion()), CurrentTool(tool),
+  TargetGenerator(g)
+{
+  // Preprocessor definitions are not allowed for linker tools.
+  this->AllowDefine = (tool != Linker);
+
+  // Slash options are allowed for VS.
+  this->AllowSlash = true;
+
+  this->FortranRuntimeDebug = false;
+  this->FortranRuntimeDLL = false;
+  this->FortranRuntimeMT = false;
+}
+
+//----------------------------------------------------------------------------
+cmVisualStudioGeneratorOptions
+::cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg,
+                                 Tool tool,
                                  cmVS7FlagTable const* table,
                                  cmVS7FlagTable const* extraTable,
                                  cmVisualStudio10TargetGenerator* g):
@@ -36,9 +56,8 @@ cmVisualStudioGeneratorOptions
   TargetGenerator(g)
 {
   // Store the given flag tables.
-  cmIDEFlagTable const** ft = this->FlagTable;
-  if(table) { *ft++ = table; }
-  if(extraTable) { *ft++ = extraTable; }
+  this->AddTable(table);
+  this->AddTable(extraTable);
 
   // Preprocessor definitions are not allowed for linker tools.
   this->AllowDefine = (tool != Linker);
@@ -52,6 +71,22 @@ cmVisualStudioGeneratorOptions
 }
 
 //----------------------------------------------------------------------------
+void cmVisualStudioGeneratorOptions::AddTable(cmVS7FlagTable const* table)
+{
+  if(table)
+    {
+    for(int i=0; i < FlagTableCount; ++i)
+      {
+      if (!this->FlagTable[i])
+        {
+        this->FlagTable[i] = table;
+        break;
+        }
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
 void cmVisualStudioGeneratorOptions::FixExceptionHandlingDefault()
 {
   // Exception handling is on by default because the platform file has
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index 9951033..5490a43 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -38,6 +38,13 @@ public:
                                  cmVS7FlagTable const* extraTable = 0,
                                  cmVisualStudio10TargetGenerator* g = 0);
 
+  cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg,
+                                 Tool tool,
+                                 cmVisualStudio10TargetGenerator* g = 0);
+
+  // Add a table of flags.
+  void AddTable(cmVS7FlagTable const* table);
+
   // Store options from command line flags.
   void Parse(const char* flags);
   void ParseFinish();

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

Summary of changes:
 Source/cmLocalVisualStudio7Generator.cxx  |   18 +++++++++++--
 Source/cmVisualStudioGeneratorOptions.cxx |   41 ++++++++++++++++++++++++++---
 Source/cmVisualStudioGeneratorOptions.h   |    7 +++++
 3 files changed, 61 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list