diff options
author | Kenney Phillis <kphillisjr@gmail.com> | 2020-03-06 05:18:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-04-21 12:10:45 (GMT) |
commit | 7ca13e04fa9301325d7d0f7cd664829e65f2b4c1 (patch) | |
tree | 308334f0e41a9eebca2d5dcdec46fd42d9921930 /Source/cmcmd.cxx | |
parent | b8b804e2ed8dca3c6d116a6e8a1cb66cbd6ad241 (diff) | |
download | CMake-7ca13e04fa9301325d7d0f7cd664829e65f2b4c1.zip CMake-7ca13e04fa9301325d7d0f7cd664829e65f2b4c1.tar.gz CMake-7ca13e04fa9301325d7d0f7cd664829e65f2b4c1.tar.bz2 |
Windows: Merge user-provided manifests into compiled resource
Previously we merged user-provided manifests only into the manifest file
given to the linker. Merge them into the manifest file that is compiled
as a resource too.
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 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); |