From e824136a3b850e7b2760bbef7b9572332ca4a285 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 22 Nov 2018 09:26:09 +0100 Subject: [PATCH] Rename VcProjGenerator::[autogen]precompCPP to [autogen]precompSource Those names are a better fit as we want to support C precompiled headers in a subsequent commit. Change-Id: Ie3f852da945b9b2cf0e363c81f1a4b3063f27372 Reviewed-by: Oliver Wolff --- qmake/generators/win32/msvc_objectmodel.cpp | 8 ++++---- qmake/generators/win32/msvc_vcproj.cpp | 14 +++++++------- qmake/generators/win32/msvc_vcproj.h | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 4f0cee65e1..442010a3a9 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2213,8 +2213,8 @@ void VCFilter::addFiles(const ProStringList& fileList) void VCFilter::modifyPCHstage(QString str) { - bool autogenSourceFile = Project->autogenPrecompCPP; - bool pchThroughSourceFile = !Project->precompCPP.isEmpty(); + bool autogenSourceFile = Project->autogenPrecompSource; + bool pchThroughSourceFile = !Project->precompSource.isEmpty(); bool isCFile = false; for (QStringList::Iterator it = Option::c_ext.begin(); it != Option::c_ext.end(); ++it) { if (str.endsWith(*it)) { @@ -2223,7 +2223,7 @@ void VCFilter::modifyPCHstage(QString str) } } const bool isHFile = (str == Project->precompH); - bool isCPPFile = pchThroughSourceFile && (str == Project->precompCPP); + bool isCPPFile = pchThroughSourceFile && (str == Project->precompSource); if(!isCFile && !isHFile && !isCPPFile) return; @@ -2231,7 +2231,7 @@ void VCFilter::modifyPCHstage(QString str) if(isHFile && pchThroughSourceFile) { if (autogenSourceFile) { useCustomBuildTool = true; - QString toFile(Project->precompCPP); + QString toFile(Project->precompSource); CustomBuildTool.Description = "Generating precompiled header source file '" + toFile + "' ..."; CustomBuildTool.Outputs += toFile; diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index db2a16ae35..8c0b801891 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -775,7 +775,7 @@ void VcprojGenerator::init() // Setup PCH variables precompH = project->first("PRECOMPILED_HEADER").toQString(); - precompCPP = project->first("PRECOMPILED_SOURCE").toQString(); + precompSource = project->first("PRECOMPILED_SOURCE").toQString(); usePCH = !precompH.isEmpty() && project->isActiveConfig("precompile_header"); if (usePCH) { precompHFilename = fileInfo(precompH).fileName(); @@ -790,13 +790,13 @@ void VcprojGenerator::init() project->values("PRECOMPILED_OBJECT") = ProStringList(precompObj); project->values("PRECOMPILED_PCH") = ProStringList(precompPch); - autogenPrecompCPP = precompCPP.isEmpty() && project->isActiveConfig("autogen_precompile_source"); - if (autogenPrecompCPP) { - precompCPP = precompH + autogenPrecompSource = precompSource.isEmpty() && project->isActiveConfig("autogen_precompile_source"); + if (autogenPrecompSource) { + precompSource = precompH + (Option::cpp_ext.count() ? Option::cpp_ext.at(0) : QLatin1String(".cpp")); - project->values("GENERATED_SOURCES") += precompCPP; - } else if (!precompCPP.isEmpty()) { - project->values("SOURCES") += precompCPP; + project->values("GENERATED_SOURCES") += precompSource; + } else if (!precompSource.isEmpty()) { + project->values("SOURCES") += precompSource; } } diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index 6af5ec7007..fafc69d9ab 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -57,9 +57,9 @@ public: ~VcprojGenerator(); QString defaultMakefile() const; - QString precompH, precompHFilename, precompCPP, + QString precompH, precompHFilename, precompSource, precompObj, precompPch; - bool autogenPrecompCPP; + bool autogenPrecompSource; static bool hasBuiltinCompiler(const QString &file); QHash extraCompilerSources;