summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2019-11-12 13:28:34 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-11-12 13:28:46 (GMT)
commit9a935adca9f969931cedd1b5a3fdfef5bfcbc9d4 (patch)
tree02caa234d71af44294df7e8961d2f926955b204c /Source/cmLocalGenerator.cxx
parentbec38523de60cd7602b0fa89d38356c6f5e7cddd (diff)
parente01935ac9d61e22be49f26910a76769585d7a257 (diff)
downloadCMake-9a935adca9f969931cedd1b5a3fdfef5bfcbc9d4.zip
CMake-9a935adca9f969931cedd1b5a3fdfef5bfcbc9d4.tar.gz
CMake-9a935adca9f969931cedd1b5a3fdfef5bfcbc9d4.tar.bz2
Merge topic 'pch-no-duplicates'
e01935ac9d PCH: No repeated path for internal generated PCH files Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4030
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 4b9b015..db35c58 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -3122,6 +3122,14 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
const char* pchExtension = source.GetProperty("PCH_EXTENSION");
if (pchExtension) {
customOutputExtension = pchExtension;
+
+ // Make sure that for the CMakeFiles/<target>.dir/cmake_pch.h|xx.c|xx
+ // source file, we don't end up having
+ // CMakeFiles/<target>.dir/CMakeFiles/<target>.dir/cmake_pch.h|xx.pch
+ cmsys::RegularExpression var("(CMakeFiles/[^/]+.dir/)");
+ while (var.find(objectName)) {
+ objectName.erase(var.start(), var.end() - var.start());
+ }
}
// Remove the source extension if it is to be replaced.