From b38c7a452e79f424e8ea9133b329d3cd4661af26 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 17 Oct 2023 16:42:14 +0200 Subject: [PATCH] CMakeProjectManager: Fix path construction of pch files This triggered soft asserts in FileUtils::copyIfDifferent() when opening top-level qt. Amends 246f33c20d which introduced a unwanted extra .parentDir() call which removed part of the path. Change-Id: Id0475a74a589372d37b7ec65d33d3faf6194013c Reviewed-by: Cristian Adam --- src/plugins/cmakeprojectmanager/fileapidataextractor.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index fd492289555..79b17536bb3 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -497,10 +497,7 @@ static RawProjectParts generateRawProjectParts(const QFuture &cancelFuture return si.path.endsWith(ending); }).path); if (!precompiled_header.isEmpty()) { - if (precompiled_header.toFileInfo().isRelative()) { - const FilePath parentDir = sourceDirectory.parentDir(); - precompiled_header = parentDir.pathAppended(precompiled_header.toString()); - } + precompiled_header = sourceDirectory.resolvePath(precompiled_header); // Remove the CMake PCH usage command line options in order to avoid the case // when the build system would produce a .pch/.gch file that would be treated