From 98b448ee9e1fc12181667c5f7431163097466daf Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 9 Feb 2011 12:59:09 -0500 Subject: VS2010: Fixed GenerateManifest flag (#10704) Thanks to "McBen " for the patch. (Did not preserve original commit author information because we have a push check for first and last name, and do not accept authors with only an alias...) --- Source/cmIDEOptions.cxx | 6 ++++++ Source/cmIDEOptions.h | 1 + Source/cmVisualStudio10TargetGenerator.cxx | 14 +++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx index 7acb0f0..d9c0e87 100644 --- a/Source/cmIDEOptions.cxx +++ b/Source/cmIDEOptions.cxx @@ -171,3 +171,9 @@ void cmIDEOptions::AddFlag(const char* flag, const char* value) { this->FlagMap[flag] = value; } + +//---------------------------------------------------------------------------- +void cmIDEOptions::RemoveFlag(const char* flag) +{ + this->FlagMap.erase(flag); +} diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h index a156b23..a5be8fb 100644 --- a/Source/cmIDEOptions.h +++ b/Source/cmIDEOptions.h @@ -28,6 +28,7 @@ public: void AddDefine(const std::string& define); void AddDefines(const char* defines); void AddFlag(const char* flag, const char* value); + void RemoveFlag(const char* flag); protected: // create a map of xml tags to the values they should have in the output diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 4cb745e..8a27ffd 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -167,6 +167,7 @@ void cmVisualStudio10TargetGenerator::Generate() // Write the encoding header into the file char magic[] = {0xEF,0xBB, 0xBF}; this->BuildFileStream->write(magic, 3); + this->WriteString("\n",0); this->WriteString("WritePlatformConfigTag("LinkIncremental", configName.c_str(), 3); *this->BuildFileStream << incremental << "\n"; + + const char* manifest = "true"; + if(flags.find("MANIFEST:NO") != flags.npos) + { + manifest = "false"; + } + this->WritePlatformConfigTag("GenerateManifest", configName.c_str(), 3); + *this->BuildFileStream << manifest + << "\n"; } //---------------------------------------------------------------------------- @@ -1326,7 +1336,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& linkDirs += "%(AdditionalLibraryDirectories)"; linkOptions.AddFlag("AdditionalLibraryDirectories", linkDirs.c_str()); linkOptions.AddFlag("AdditionalDependencies", libs.c_str()); - linkOptions.AddFlag("Version", "0.0"); + linkOptions.AddFlag("Version", ""); if(linkOptions.IsDebug() || flags.find("/debug") != flags.npos) { linkOptions.AddFlag("GenerateDebugInformation", "true"); @@ -1369,6 +1379,8 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& linkOptions.AddFlag("ModuleDefinitionFile", this->ModuleDefinitionFile.c_str()); } + + linkOptions.RemoveFlag("GenerateManifest"); linkOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", ""); linkOptions.OutputFlagMap(*this->BuildFileStream, " "); -- cgit v0.12