summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-02-22 19:31:55 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-02-22 19:31:55 (GMT)
commitcc5bbed52a73e8381ae682c171f6b314f8f9f6d5 (patch)
tree3745d5a4f96e73b681feb9470385482709e49423
parent15ff343d23c7c424bc56fd1f156869d8d00e3c34 (diff)
parentfbca267331b1d85f92ea27dfcb9490369c56cf77 (diff)
downloadCMake-cc5bbed52a73e8381ae682c171f6b314f8f9f6d5.zip
CMake-cc5bbed52a73e8381ae682c171f6b314f8f9f6d5.tar.gz
CMake-cc5bbed52a73e8381ae682c171f6b314f8f9f6d5.tar.bz2
Merge topic 'fix-10704-manifest-no-vs10'
fbca267 VS: Only use /MANIFEST if hasManifest is true (#11216) 98b448e VS2010: Fixed GenerateManifest flag (#10704)
-rw-r--r--Source/cmIDEOptions.cxx6
-rw-r--r--Source/cmIDEOptions.h1
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx14
-rw-r--r--Source/cmake.cxx5
4 files changed, 24 insertions, 2 deletions
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("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",0);
this->WriteString("<Project DefaultTargets=\"Build\" "
"ToolsVersion=\"4.0\" "
"xmlns=\"http://schemas.microsoft.com/"
@@ -998,6 +999,15 @@ OutputLinkIncremental(std::string const& configName)
this->WritePlatformConfigTag("LinkIncremental", configName.c_str(), 3);
*this->BuildFileStream << incremental
<< "</LinkIncremental>\n";
+
+ const char* manifest = "true";
+ if(flags.find("MANIFEST:NO") != flags.npos)
+ {
+ manifest = "false";
+ }
+ this->WritePlatformConfigTag("GenerateManifest", configName.c_str(), 3);
+ *this->BuildFileStream << manifest
+ << "</GenerateManifest>\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, " ");
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 0c03b65..81324b6 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -4134,7 +4134,10 @@ int cmake::VisualStudioLinkNonIncremental(std::vector<std::string>& args,
return -1;
}
// Run the link command as given
- linkCommand.push_back("/MANIFEST");
+ if (hasManifest)
+ {
+ linkCommand.push_back("/MANIFEST");
+ }
if(!cmake::RunCommand("LINK", linkCommand, verbose))
{
return -1;