From 059e1df345bab5754488a63e6d149de86ebf655a Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 16 Jun 2015 12:31:51 +0200 Subject: [PATCH] fix PCH related regression in vcxproj generator When PRECOMPILED_HEADER is set to foo/bar/stable.h and PRECOMPILED_SOURCE is empty, then a C++ file foo/bar/stable.cpp is generated that contains the include "stable.h". We must pass the exact string "stable.h" to the /Yc compile switch instead of "foo/bar/stable.h". Commit dc612acdc6577594c8f61345cea2de549d7aae34 introduced this regression to allow to have PRECOMPILED_SOURCE in a different directory than PRECOMPILED_HEADER. Change-Id: I1a7e096c0455b946a5660d23c70c72abd4c7ac1b Task-number: QTBUG-46679 Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msvc_objectmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index aa7320bc27..09937c8ac2 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2238,6 +2238,8 @@ void VCFilter::modifyPCHstage(QString str) CompilerTool.UsePrecompiledHeader = (isCFile ? pchNone : pchCreateUsingSpecific); if (isCFile) CompilerTool.PrecompiledHeaderThrough = QLatin1String("$(NOINHERIT)"); + else if (autogenSourceFile) + CompilerTool.PrecompiledHeaderThrough = Project->precompHFilename; CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); }