[Cmake-commits] CMake branch, next, updated. v3.0.0-4184-g41550f2

Brad King brad.king at kitware.com
Thu Jul 10 14:40:57 EDT 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  41550f2d90eed9327fee873611a2e9f5094b5614 (commit)
       via  5d8738468f3eb6f45035d1f77c23ef5fdf490af6 (commit)
      from  ef1a3b5951d834299eea6400949c2a94fdf3ad0a (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=41550f2d90eed9327fee873611a2e9f5094b5614
commit 41550f2d90eed9327fee873611a2e9f5094b5614
Merge: ef1a3b5 5d87384
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 10 14:40:56 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jul 10 14:40:56 2014 -0400

    Merge topic 'vs-RC-flags' into next
    
    5d873846 VS: Fix handling of non-preprocessor flags in CMAKE_RC_FLAGS


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d8738468f3eb6f45035d1f77c23ef5fdf490af6
commit 5d8738468f3eb6f45035d1f77c23ef5fdf490af6
Author:     Martin Mitas <mity at morous.org>
AuthorDate: Thu Jul 10 01:01:18 2014 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jul 10 14:33:27 2014 -0400

    VS: Fix handling of non-preprocessor flags in CMAKE_RC_FLAGS
    
    Teach the VS >= 10 generator to honor flags other than -I and -D
    in the CMAKE_RC_FLAGS[_<CONFIG>] variable.  Place them within the
    ResourceCompile .vcxproj element under AdditionalOptions.
    
    Also add a rudimentary flag map to map '-n' to 'NullTerminateStrings'.

diff --git a/Source/cmVS10RCFlagTable.h b/Source/cmVS10RCFlagTable.h
new file mode 100644
index 0000000..9049986
--- /dev/null
+++ b/Source/cmVS10RCFlagTable.h
@@ -0,0 +1,7 @@
+static cmVS7FlagTable cmVS10RCFlagTable[] =
+{
+  //Bool Properties
+  {"NullTerminateStrings", "n", "", "true", 0},
+
+  {0,0,0,0,0}
+};
diff --git a/Source/cmVS11RCFlagTable.h b/Source/cmVS11RCFlagTable.h
new file mode 100644
index 0000000..a7d2de1
--- /dev/null
+++ b/Source/cmVS11RCFlagTable.h
@@ -0,0 +1,7 @@
+static cmVS7FlagTable cmVS11RCFlagTable[] =
+{
+  //Bool Properties
+  {"NullTerminateStrings", "n", "", "true", 0},
+
+  {0,0,0,0,0}
+};
diff --git a/Source/cmVS12RCFlagTable.h b/Source/cmVS12RCFlagTable.h
new file mode 100644
index 0000000..1551c66
--- /dev/null
+++ b/Source/cmVS12RCFlagTable.h
@@ -0,0 +1,7 @@
+static cmVS7FlagTable cmVS12RCFlagTable[] =
+{
+  //Bool Properties
+  {"NullTerminateStrings", "n", "", "true", 0},
+
+  {0,0,0,0,0}
+};
diff --git a/Source/cmVS14RCFlagTable.h b/Source/cmVS14RCFlagTable.h
new file mode 100644
index 0000000..ebd8d65
--- /dev/null
+++ b/Source/cmVS14RCFlagTable.h
@@ -0,0 +1,7 @@
+static cmVS7FlagTable cmVS14RCFlagTable[] =
+{
+  //Bool Properties
+  {"NullTerminateStrings", "n", "", "true", 0},
+
+  {0,0,0,0,0}
+};
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 1e09ed9..0458bd6 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -21,15 +21,19 @@
 #include "cmLocalVisualStudio7Generator.h"
 #include "cmCustomCommandGenerator.h"
 #include "cmVS10CLFlagTable.h"
+#include "cmVS10RCFlagTable.h"
 #include "cmVS10LinkFlagTable.h"
 #include "cmVS10LibFlagTable.h"
 #include "cmVS11CLFlagTable.h"
+#include "cmVS11RCFlagTable.h"
 #include "cmVS11LinkFlagTable.h"
 #include "cmVS11LibFlagTable.h"
 #include "cmVS12CLFlagTable.h"
+#include "cmVS12RCFlagTable.h"
 #include "cmVS12LinkFlagTable.h"
 #include "cmVS12LibFlagTable.h"
 #include "cmVS14CLFlagTable.h"
+#include "cmVS14RCFlagTable.h"
 #include "cmVS14LinkFlagTable.h"
 #include "cmVS14LibFlagTable.h"
 
@@ -49,6 +53,20 @@ cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetClFlagTable() const
     { return cmVS10CLFlagTable; }
 }
 
+cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetRcFlagTable() const
+{
+  cmLocalVisualStudioGenerator::VSVersion
+    v = this->LocalGenerator->GetVersion();
+  if(v >= cmLocalVisualStudioGenerator::VS14)
+    { return cmVS14RCFlagTable; }
+  else if(v >= cmLocalVisualStudioGenerator::VS12)
+    { return cmVS12RCFlagTable; }
+  else if(v == cmLocalVisualStudioGenerator::VS11)
+    { return cmVS11RCFlagTable; }
+  else
+    { return cmVS10RCFlagTable; }
+}
+
 cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetLibFlagTable() const
 {
   cmLocalVisualStudioGenerator::VSVersion
@@ -212,6 +230,10 @@ void cmVisualStudio10TargetGenerator::Generate()
       {
       return;
       }
+    if(!this->ComputeRcOptions())
+      {
+      return;
+      }
     if(!this->ComputeLinkOptions())
       {
       return;
@@ -1504,15 +1526,59 @@ OutputIncludes(std::vector<std::string> const & includes)
 
 
 
+//----------------------------------------------------------------------------
+bool cmVisualStudio10TargetGenerator::ComputeRcOptions()
+{
+  std::vector<std::string> const* configs =
+    this->GlobalGenerator->GetConfigurations();
+  for(std::vector<std::string>::const_iterator i = configs->begin();
+      i != configs->end(); ++i)
+    {
+    if(!this->ComputeRcOptions(*i))
+      {
+      return false;
+      }
+    }
+  return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmVisualStudio10TargetGenerator::ComputeRcOptions(
+  std::string const& configName)
+{
+  cmsys::auto_ptr<Options> pOptions(
+    new Options(this->LocalGenerator, Options::ResourceCompiler,
+                this->GetRcFlagTable()));
+  Options& rcOptions = *pOptions;
+
+  std::string CONFIG = cmSystemTools::UpperCase(configName);
+  std::string rcConfigFlagsVar = std::string("CMAKE_RC_FLAGS_") + CONFIG;
+  std::string flags =
+      std::string(this->Makefile->GetSafeDefinition("CMAKE_RC_FLAGS")) +
+      std::string(" ") +
+      std::string(this->Makefile->GetSafeDefinition(rcConfigFlagsVar));
+
+  rcOptions.Parse(flags.c_str());
+  this->RcOptions[configName] = pOptions.release();
+  return true;
+}
+
 void cmVisualStudio10TargetGenerator::
 WriteRCOptions(std::string const& configName,
                std::vector<std::string> const & includes)
 {
   this->WriteString("<ResourceCompile>\n", 2);
+
+  // Preprocessor definitions and includes are shared with clOptions.
   Options& clOptions = *(this->ClOptions[configName]);
   clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, "      ",
                                           "\n", "RC");
   this->OutputIncludes(includes);
+
+  Options& rcOptions = *(this->RcOptions[configName]);
+  rcOptions.OutputFlagMap(*this->BuildFileStream, "      ");
+  rcOptions.OutputAdditionalOptions(*this->BuildFileStream, "      ", "");
+
   this->WriteString("</ResourceCompile>\n", 2);
 }
 
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 8f2faca..6bdb40a 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -72,6 +72,8 @@ private:
   bool ComputeClOptions(std::string const& configName);
   void WriteClOptions(std::string const& config,
                       std::vector<std::string> const & includes);
+  bool ComputeRcOptions();
+  bool ComputeRcOptions(std::string const& config);
   void WriteRCOptions(std::string const& config,
                       std::vector<std::string> const & includes);
   bool ComputeLinkOptions();
@@ -101,6 +103,7 @@ private:
   bool IsResxHeader(const std::string& headerFile);
 
   cmIDEFlagTable const* GetClFlagTable() const;
+  cmIDEFlagTable const* GetRcFlagTable() const;
   cmIDEFlagTable const* GetLibFlagTable() const;
   cmIDEFlagTable const* GetLinkFlagTable() const;
 
@@ -108,6 +111,7 @@ private:
   typedef cmVisualStudioGeneratorOptions Options;
   typedef std::map<std::string, Options*> OptionsMap;
   OptionsMap ClOptions;
+  OptionsMap RcOptions;
   OptionsMap LinkOptions;
   std::string PathToVcxproj;
   cmTarget* Target;
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index 214b893..47a7c62 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -27,6 +27,7 @@ public:
   enum Tool
   {
     Compiler,
+    ResourceCompiler,
     Linker,
     FortranCompiler
   };

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

Summary of changes:
 Source/cmVS10RCFlagTable.h                 |    7 +++
 Source/cmVS11RCFlagTable.h                 |    7 +++
 Source/cmVS12RCFlagTable.h                 |    7 +++
 Source/cmVS14RCFlagTable.h                 |    7 +++
 Source/cmVisualStudio10TargetGenerator.cxx |   66 ++++++++++++++++++++++++++++
 Source/cmVisualStudio10TargetGenerator.h   |    4 ++
 Source/cmVisualStudioGeneratorOptions.h    |    1 +
 7 files changed, 99 insertions(+)
 create mode 100644 Source/cmVS10RCFlagTable.h
 create mode 100644 Source/cmVS11RCFlagTable.h
 create mode 100644 Source/cmVS12RCFlagTable.h
 create mode 100644 Source/cmVS14RCFlagTable.h


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list