summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-01-28 19:17:54 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-01-28 19:17:54 (GMT)
commitecfe0f7ca8e017ac78015616e957d709d08e424e (patch)
tree2fe25c739214af3b262cdbc2a94c752b3b8dd5ae /Source
parentba718fb8275e98c8404c6362f8ac675165bbfef1 (diff)
parent008d116b1767cb93c043e399ab607bcc8db5c175 (diff)
downloadCMake-ecfe0f7ca8e017ac78015616e957d709d08e424e.zip
CMake-ecfe0f7ca8e017ac78015616e957d709d08e424e.tar.gz
CMake-ecfe0f7ca8e017ac78015616e957d709d08e424e.tar.bz2
Merge topic 'fix-11695-spaces-in-vs10-rc-defs'
008d116 VSResource: Avoid windres /D with quoted spaces (#11695) 8f9919d Avoid space in rc /D values for VS6 and Cygwin (#11695) 78fe97f Fix line too long KWStyle issue (#11695) 6627560 VS10: Escape double quote chars in defines for rc files (#11695)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx9
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx11
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx8
-rw-r--r--Source/cmVisualStudioGeneratorOptions.h3
4 files changed, 22 insertions, 9 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 34756d8..e839ed3 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -755,7 +755,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
}
fout << "\"\n";
targetOptions.OutputFlagMap(fout, "\t\t\t\t");
- targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n");
+ targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX");
fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n";
fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n";
if(targetBuilds)
@@ -789,7 +789,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
}
// add the -D flags to the RC tool
fout << "\"";
- targetOptions.OutputPreprocessorDefinitions(fout, "\n\t\t\t\t", "");
+ targetOptions.OutputPreprocessorDefinitions(fout, "\n\t\t\t\t", "", "RC");
fout << "/>\n";
tool = "VCMIDLTool";
if(this->FortranProject)
@@ -1462,6 +1462,7 @@ void cmLocalVisualStudio7Generator
else if(!fcinfo.FileConfigMap.empty())
{
const char* aCompilerTool = "VCCLCompilerTool";
+ const char* lang = "CXX";
if(this->FortranProject)
{
aCompilerTool = "VFFortranCompilerTool";
@@ -1479,6 +1480,7 @@ void cmLocalVisualStudio7Generator
if(ext == "rc")
{
aCompilerTool = "VCResourceCompilerTool";
+ lang = "RC";
if(this->FortranProject)
{
aCompilerTool = "VFResourceCompilerTool";
@@ -1520,7 +1522,8 @@ void cmLocalVisualStudio7Generator
fileOptions.OutputAdditionalOptions(fout, "\t\t\t\t\t", "\n");
fileOptions.OutputFlagMap(fout, "\t\t\t\t\t");
fileOptions.OutputPreprocessorDefinitions(fout,
- "\t\t\t\t\t", "\n");
+ "\t\t\t\t\t", "\n",
+ lang);
}
if(!fc.AdditionalDeps.empty())
{
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 2d55e1e..4cb745e 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -717,6 +717,10 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
// is ended on a new line
this->WriteString("</ClCompile>\n", 2);
}
+ else if(!header && rc && this->OutputSourceSpecificFlags(*source))
+ {
+ this->WriteString("</ResourceCompile>\n", 2);
+ }
else
{
(*this->BuildFileStream ) << " />\n";
@@ -853,8 +857,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
clOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
clOptions.OutputFlagMap(*this->BuildFileStream, " ");
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream,
- " ", "\n");
-
+ " ", "\n", lang);
}
}
return hasFlags;
@@ -1120,7 +1123,7 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
}
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
- "\n");
+ "\n", "CXX");
this->WriteString("<AssemblerListingLocation>", 3);
*this->BuildFileStream << configName
<< "</AssemblerListingLocation>\n";
@@ -1155,7 +1158,7 @@ WriteRCOptions(std::string const& configName,
this->WriteString("<ResourceCompile>\n", 2);
Options& clOptions = *(this->ClOptions[configName]);
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
- "\n");
+ "\n", "RC");
this->OutputIncludes(includes);
this->WriteString("</ResourceCompile>\n", 2);
}
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 9acae0d..ed0d60c 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -204,7 +204,8 @@ void
cmVisualStudioGeneratorOptions
::OutputPreprocessorDefinitions(std::ostream& fout,
const char* prefix,
- const char* suffix)
+ const char* suffix,
+ const char* lang)
{
if(this->Defines.empty())
{
@@ -251,6 +252,11 @@ cmVisualStudioGeneratorOptions
if(this->Version == 10)
{
define = cmVisualStudio10GeneratorOptionsEscapeForXML(define.c_str());
+
+ if(0 == strcmp(lang, "RC"))
+ {
+ cmSystemTools::ReplaceString(define, "\"", "\\\"");
+ }
}
else
{
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index 8619ba0..fadc4b5 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -54,7 +54,8 @@ public:
// Write options to output.
void OutputPreprocessorDefinitions(std::ostream& fout,
const char* prefix,
- const char* suffix);
+ const char* suffix,
+ const char* lang);
void OutputFlagMap(std::ostream& fout, const char* indent);
void OutputAdditionalOptions(std::ostream& fout,
const char* prefix,