summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-12-09 15:15:08 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-12-09 15:15:19 (GMT)
commit835f1bcbdec21ec7acf84e7ed4c9d45a2dabb602 (patch)
treeb62d7e1e21ecfa50f7f4b5209a2f0bcea762dcae /Source/cmLocalGenerator.cxx
parent5d6b70ccfe3b2ce986b1f05a25f93f763498ee17 (diff)
parent93becd61d19baa718bb10f2df25fedf31dfc2ded (diff)
downloadCMake-835f1bcbdec21ec7acf84e7ed4c9d45a2dabb602.zip
CMake-835f1bcbdec21ec7acf84e7ed4c9d45a2dabb602.tar.gz
CMake-835f1bcbdec21ec7acf84e7ed4c9d45a2dabb602.tar.bz2
Merge topic 'pch-reuse-importlib'
93becd61d1 PCH: Use the target's PREFIX for building the pdb file name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4114
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 7451ff3..fa997f4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2467,9 +2467,25 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
target->GetLocalGenerator()->GetCurrentBinaryDirectory(), "/",
target->GetName(), ".dir/${PDB_PREFIX}");
- file << "if (EXISTS \"" << from_file << "\")\n";
+ const std::string to_file =
+ cmStrCat(to_dir, pchReuseFrom, extension);
+
+ std::string dest_file = to_file;
+
+ const std::string prefix = target->GetSafeProperty("PREFIX");
+ if (!prefix.empty()) {
+ dest_file = cmStrCat(to_dir, prefix, pchReuseFrom, extension);
+ }
+
+ file << "if (EXISTS \"" << from_file << "\" AND \"" << from_file
+ << "\" IS_NEWER_THAN \"" << dest_file << "\")\n";
file << " file(COPY \"" << from_file << "\""
<< " DESTINATION \"" << to_dir << "\")\n";
+ if (!prefix.empty()) {
+ file << " file(REMOVE \"" << dest_file << "\")\n";
+ file << " file(RENAME \"" << to_file << "\" \"" << dest_file
+ << "\")\n";
+ }
file << "endif()\n";
}