diff options
author | Brad King <brad.king@kitware.com> | 2020-04-22 13:15:46 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-04-22 13:15:59 (GMT) |
commit | d9eb9e785e9873a7b034aec667bd808d34f1a907 (patch) | |
tree | 314c0c03cdda2504589db9535813086a72f20817 /Source/cmcmd.cxx | |
parent | f9fbc78cd638c1bb874ffd24531f98c095ca1377 (diff) | |
parent | 7ca13e04fa9301325d7d0f7cd664829e65f2b4c1 (diff) | |
download | CMake-d9eb9e785e9873a7b034aec667bd808d34f1a907.zip CMake-d9eb9e785e9873a7b034aec667bd808d34f1a907.tar.gz CMake-d9eb9e785e9873a7b034aec667bd808d34f1a907.tar.bz2 |
Merge topic 'win-user-manifest-rc'
7ca13e04fa Windows: Merge user-provided manifests into compiled resource
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4484
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r-- | Source/cmcmd.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index a663087..a8e07e4 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -2117,12 +2117,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. @@ -2190,7 +2196,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); |