Fix precompiled headers for Clang
Precompiled headers were put in a directory which had exactly the same name as the binary to be generated. This resulted in a failure with any mkspec that used clang_pch_style. The g++-mkspec avoid this problem by extending the directory name. This change adopts this technique for clang mkspecs. [ChangeLog][qmake] Fixed precompiled headers for the Clang compiler. Fixes: QTBUG-72404 Change-Id: I471462e2bcb1e33f19d277c21acde0c04b1ffcd6 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
parent
b5b9eb68c4
commit
059172c633
@ -198,9 +198,8 @@ UnixMakefileGenerator::init()
|
||||
QString headerSuffix;
|
||||
if (project->isActiveConfig("clang_pch_style"))
|
||||
headerSuffix = project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
|
||||
else
|
||||
pchBaseName += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
|
||||
|
||||
pchBaseName += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
|
||||
pchBaseName += Option::dir_sep;
|
||||
|
||||
ProString language = project->first(ProKey("QMAKE_LANGUAGE_" + compiler));
|
||||
@ -319,8 +318,7 @@ QStringList
|
||||
if(!project->isEmpty("PRECOMPILED_DIR"))
|
||||
header_prefix = project->first("PRECOMPILED_DIR").toQString();
|
||||
header_prefix += project->first("QMAKE_ORIG_TARGET").toQString();
|
||||
if (!project->isActiveConfig("clang_pch_style"))
|
||||
header_prefix += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
|
||||
header_prefix += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
|
||||
if (project->isActiveConfig("icc_pch_style")) {
|
||||
// icc style
|
||||
ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS");
|
||||
|
@ -1006,8 +1006,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
if(!project->isEmpty("PRECOMPILED_DIR"))
|
||||
precomph_out_dir = project->first("PRECOMPILED_DIR");
|
||||
precomph_out_dir += project->first("QMAKE_ORIG_TARGET");
|
||||
if (!project->isActiveConfig("clang_pch_style"))
|
||||
precomph_out_dir += project->first("QMAKE_PCH_OUTPUT_EXT");
|
||||
precomph_out_dir += project->first("QMAKE_PCH_OUTPUT_EXT");
|
||||
|
||||
if (project->isActiveConfig("icc_pch_style")) {
|
||||
// icc style
|
||||
@ -1126,8 +1125,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
if(!project->isEmpty("PRECOMPILED_DIR"))
|
||||
pchOutput = project->first("PRECOMPILED_DIR");
|
||||
pchOutput += pchBaseName;
|
||||
if (!project->isActiveConfig("clang_pch_style"))
|
||||
pchOutput += project->first("QMAKE_PCH_OUTPUT_EXT");
|
||||
pchOutput += project->first("QMAKE_PCH_OUTPUT_EXT");
|
||||
|
||||
if (!project->isActiveConfig("icc_pch_style")) {
|
||||
// gcc style (including clang_pch_style)
|
||||
|
Loading…
x
Reference in New Issue
Block a user