diff options
author | Brad King <brad.king@kitware.com> | 2019-12-09 15:15:08 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-12-09 15:15:19 (GMT) |
commit | 47c6b6cdee55714dd4ce9b0769e57b2cbe499667 (patch) | |
tree | 559b20456e09fd80d9eebde1f30ef60eebf4484a /Source | |
parent | b4568361d2202644dc8bf23ac1cea8ed874efaf5 (diff) | |
parent | 93becd61d19baa718bb10f2df25fedf31dfc2ded (diff) | |
download | CMake-47c6b6cdee55714dd4ce9b0769e57b2cbe499667.zip CMake-47c6b6cdee55714dd4ce9b0769e57b2cbe499667.tar.gz CMake-47c6b6cdee55714dd4ce9b0769e57b2cbe499667.tar.bz2 |
Merge topic 'pch-reuse-importlib' into release-3.16
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')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2e499b3..691bd0d 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2381,9 +2381,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"; } |