[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3678-g03789fe

Patrick Gansterer paroga at paroga.com
Mon Aug 5 10:41:58 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  03789fe34fad71cea77b1feb57adc0d241021233 (commit)
       via  28e770cf6eb1be898e6904e85849f701ab71b5c1 (commit)
      from  290124a188fb82b0e643ba5566769359dc8882bb (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=03789fe34fad71cea77b1feb57adc0d241021233
commit 03789fe34fad71cea77b1feb57adc0d241021233
Merge: 290124a 28e770c
Author:     Patrick Gansterer <paroga at paroga.com>
AuthorDate: Mon Aug 5 10:41:55 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Aug 5 10:41:55 2013 -0400

    Merge topic 'vs-masm' into next
    
    28e770c VS10: Add support for assembler code (#11536)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28e770cf6eb1be898e6904e85849f701ab71b5c1
commit 28e770cf6eb1be898e6904e85849f701ab71b5c1
Author:     Patrick Gansterer <paroga at paroga.com>
AuthorDate: Mon Aug 5 16:34:10 2013 +0200
Commit:     Patrick Gansterer <paroga at paroga.com>
CommitDate: Mon Aug 5 16:34:10 2013 +0200

    VS10: Add support for assembler code (#11536)
    
    Use the masm BuildCustomizations, which are part of the Visual
    Studio installation to allow compilation of asm files.

diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 0837f99..9b14051 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -79,6 +79,7 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
   this->ExpressEdition = cmSystemTools::ReadRegistryValue(
     "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0\\Setup\\VC;"
     "ProductDir", vc10Express, cmSystemTools::KeyWOW64_32);
+  this->MasmEnabled = false;
 }
 
 //----------------------------------------------------------------------------
@@ -168,6 +169,16 @@ void cmGlobalVisualStudio10Generator
       return;
       }
     }
+
+  for(std::vector<std::string>::const_iterator it = lang.begin();
+      it != lang.end(); ++it)
+    {
+    if(*it == "ASM_MASM")
+      {
+      this->MasmEnabled = true;
+      }
+    }
+
   cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional);
 }
 
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index dbe6044..00f8d33 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -54,6 +54,9 @@ public:
   /** Is the installed VS an Express edition?  */
   bool IsExpressEdition() const { return this->ExpressEdition; }
 
+  /** Is the Microsoft Assembler enabled?  */
+  bool IsMasmEnabled() const { return this->MasmEnabled; }
+
   /** The toolset name for the target platform.  */
   const char* GetPlatformToolset();
 
@@ -83,6 +86,7 @@ protected:
 
   std::string PlatformToolset;
   bool ExpressEdition;
+  bool MasmEnabled;
 
   bool UseFolderProperty();
 
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 937509e..ea05347 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -307,6 +307,11 @@ void cmVisualStudio10TargetGenerator::Generate()
   this->WriteString(
     "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n", 1);
   this->WriteString("<ImportGroup Label=\"ExtensionSettings\">\n", 1);
+  if (this->GlobalGenerator->IsMasmEnabled())
+    {
+    this->WriteString("<Import Project=\"$(VCTargetsPath)\\"
+                      "BuildCustomizations\\masm.props\" />\n", 2);
+    }
   this->WriteString("</ImportGroup>\n", 1);
   this->WriteString("<ImportGroup Label=\"PropertySheets\">\n", 1);
   this->WriteString("<Import Project=\"" VS10_USER_PROPS "\""
@@ -326,6 +331,11 @@ void cmVisualStudio10TargetGenerator::Generate()
     "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\""
     " />\n", 1);
   this->WriteString("<ImportGroup Label=\"ExtensionTargets\">\n", 1);
+  if (this->GlobalGenerator->IsMasmEnabled())
+    {
+    this->WriteString("<Import Project=\"$(VCTargetsPath)\\"
+                      "BuildCustomizations\\masm.targets\" />\n", 2);
+    }
   this->WriteString("</ImportGroup>\n", 1);
   this->WriteString("</Project>", 0);
   // The groups are stored in a separate file for VS 10
@@ -982,24 +992,37 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
       si != this->GeneratorTarget->ObjectSources.end(); ++si)
     {
     const char* lang = (*si)->GetLanguage();
-    bool cl = strcmp(lang, "C") == 0 || strcmp(lang, "CXX") == 0;
-    bool rc = strcmp(lang, "RC") == 0;
-    const char* tool = cl? "ClCompile" : (rc? "ResourceCompile" : "None");
-    this->WriteSource(tool, *si, " ");
-    // ouput any flags specific to this source file
-    if(cl && this->OutputSourceSpecificFlags(*si))
+    const char* tool = NULL;
+    if (strcmp(lang, "C") == 0 || strcmp(lang, "CXX") == 0)
+      {
+      tool = "ClCompile";
+      }
+    else if (strcmp(lang, "ASM_MASM") == 0 &&
+             this->GlobalGenerator->IsMasmEnabled())
+      {
+      tool = "MASM";
+      }
+    else if (strcmp(lang, "RC") == 0)
       {
-      // if the source file has specific flags the tag
-      // is ended on a new line
-      this->WriteString("</ClCompile>\n", 2);
+      tool = "ResourceCompile";
       }
-    else if(rc && this->OutputSourceSpecificFlags(*si))
+
+    if (tool)
       {
-      this->WriteString("</ResourceCompile>\n", 2);
+      this->WriteSource(tool, *si, " ");
+      if (this->OutputSourceSpecificFlags(*si))
+        {
+        this->WriteString("</", 2);
+        (*this->BuildFileStream ) << tool << ">\n";
+        }
+      else
+        {
+        (*this->BuildFileStream ) << " />\n";
+        }
       }
     else
       {
-      (*this->BuildFileStream ) << " />\n";
+      this->WriteSource("None", *si);
       }
     }
 

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

Summary of changes:
 Source/cmGlobalVisualStudio10Generator.cxx |   11 ++++++
 Source/cmGlobalVisualStudio10Generator.h   |    4 ++
 Source/cmVisualStudio10TargetGenerator.cxx |   47 ++++++++++++++++++++-------
 3 files changed, 50 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list