summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index c3bd160..28d68d9 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -2084,12 +2084,18 @@ int cmVSLink::LinkIncremental()
}
// If we have not previously generated a manifest file,
- // generate an empty one so the resource compiler succeeds.
+ // generate a manifest file so the resource compiler succeeds.
if (!cmSystemTools::FileExists(this->ManifestFile)) {
if (this->Verbose) {
std::cout << "Create empty: " << this->ManifestFile << "\n";
}
- cmsys::ofstream foutTmp(this->ManifestFile.c_str());
+ if (this->UserManifests.empty()) {
+ // generate an empty manifest because there are no user provided
+ // manifest files.
+ cmsys::ofstream foutTmp(this->ManifestFile.c_str());
+ } else {
+ this->RunMT("/out:" + this->ManifestFile, false);
+ }
}
// Compile the resource file.
@@ -2157,7 +2163,10 @@ int cmVSLink::RunMT(std::string const& out, bool notify)
mtCommand.push_back(this->MtPath.empty() ? "mt" : this->MtPath);
mtCommand.emplace_back("/nologo");
mtCommand.emplace_back("/manifest");
- if (this->LinkGeneratesManifest) {
+
+ // add the linker generated manifest if the file exists.
+ if (this->LinkGeneratesManifest &&
+ cmSystemTools::FileExists(this->LinkerManifestFile)) {
mtCommand.push_back(this->LinkerManifestFile);
}
cm::append(mtCommand, this->UserManifests);