diff options
author | Brad King <brad.king@kitware.com> | 2014-08-07 19:20:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-08-20 14:22:07 (GMT) |
commit | 0f8522a6c9c00afc67c367de1e1c3f601f1996e9 (patch) | |
tree | 6c5a3c94cf82611498eee851a446e08270c336e7 /Source/cmLocalVisualStudio7Generator.cxx | |
parent | a43f44000d12c1357eeed04e5a02d11236730dfa (diff) | |
download | CMake-0f8522a6c9c00afc67c367de1e1c3f601f1996e9.zip CMake-0f8522a6c9c00afc67c367de1e1c3f601f1996e9.tar.gz CMake-0f8522a6c9c00afc67c367de1e1c3f601f1996e9.tar.bz2 |
VS: Add MASM support to VS 8 and 9 (#8170, #14984)
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 29165f8..11a9627 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -44,6 +44,16 @@ private: extern cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[]; +static void cmConvertToWindowsSlash(std::string& s) +{ + std::string::size_type pos = 0; + while((pos = s.find('/', pos)) != std::string::npos) + { + s[pos] = '\\'; + pos++; + } +} + //---------------------------------------------------------------------------- cmLocalVisualStudio7Generator::cmLocalVisualStudio7Generator(VSVersion v): cmLocalVisualStudioGenerator(v) @@ -862,6 +872,31 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, } } fout << "/>\n"; // end of <Tool Name=VCCLCompilerTool + if(gg->IsMasmEnabled() && !this->FortranProject) + { + Options masmOptions(this, Options::MasmCompiler, 0, 0); + fout << + "\t\t\t<Tool\n" + "\t\t\t\tName=\"MASM\"\n" + "\t\t\t\tIncludePaths=\"" + ; + const char* sep = ""; + for(i = includes.begin(); i != includes.end(); ++i) + { + std::string inc = *i; + cmConvertToWindowsSlash(inc); + fout << sep << this->EscapeForXML(inc); + sep = ";"; + } + fout << "\"\n"; + // Use same preprocessor definitions as VCCLCompilerTool. + targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", + "ASM_MASM"); + masmOptions.OutputFlagMap(fout, "\t\t\t\t"); + fout << + "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n" + "\t\t\t/>\n"; + } tool = "VCCustomBuildTool"; if(this->FortranProject) { @@ -1700,6 +1735,7 @@ bool cmLocalVisualStudio7Generator { aCompilerTool = "VFFortranCompilerTool"; } + std::string const& lang = (*sf)->GetLanguage(); std::string ext = (*sf)->GetExtension(); ext = cmSystemTools::LowerCase(ext); if(ext == "idl") @@ -1727,6 +1763,11 @@ bool cmLocalVisualStudio7Generator aCompilerTool = "VFCustomBuildTool"; } } + if (gg->IsMasmEnabled() && !this->FortranProject && + lang == "ASM_MASM") + { + aCompilerTool = "MASM"; + } for(std::map<std::string, cmLVS7GFileConfig>::const_iterator fci = fcinfo.FileConfigMap.begin(); fci != fcinfo.FileConfigMap.end(); ++fci) @@ -2095,6 +2136,16 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, << "\t<Platforms>\n" << "\t\t<Platform\n\t\t\tName=\"" << gg->GetPlatformName() << "\"/>\n" << "\t</Platforms>\n"; + if(gg->IsMasmEnabled()) + { + fout << + "\t<ToolFiles>\n" + "\t\t<DefaultToolFile\n" + "\t\t\tFileName=\"masm.rules\"\n" + "\t\t/>\n" + "\t</ToolFiles>\n" + ; + } } |