summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2019-11-11 12:21:12 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2019-11-11 12:21:12 (GMT)
commite01935ac9d61e22be49f26910a76769585d7a257 (patch)
tree164e4f3c601c95878625352920bc390790d539d9 /Source/cmLocalGenerator.cxx
parentadf863f15e348789e4d20e3d2dd792f35d4f4725 (diff)
downloadCMake-e01935ac9d61e22be49f26910a76769585d7a257.zip
CMake-e01935ac9d61e22be49f26910a76769585d7a257.tar.gz
CMake-e01935ac9d61e22be49f26910a76769585d7a257.tar.bz2
PCH: No repeated path for internal generated PCH files
Fixes: #19952
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 cae47e0..6a9cb23 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -3123,6 +3123,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.