qmake: Stop using -isystem flag

This option changes the order of include paths, which can cause problems
of various kinds. See https://bugs.debian.org/958479 for an example.

The benefit of that option is minimal for what it was intended.

Pick-to: 5.15 5.12
Change-Id: I80eeabd09764df290b60bc59aeb2f90d07723608
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Dmitry Shachnev 2020-06-03 13:06:01 +03:00 committed by Thiago Macieira
parent ee63557112
commit f133b226cd
5 changed files with 3 additions and 17 deletions

View File

@ -18,7 +18,6 @@ QMAKE_PCH_OUTPUT_EXT = .pch
QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz
QMAKE_CFLAGS_ISYSTEM = -isystem
QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CFLAGS_USE_PRECOMPILE = -Xclang -include-pch -Xclang ${QMAKE_PCH_OUTPUT}
QMAKE_CFLAGS_LTCG = -flto=thin

View File

@ -46,7 +46,6 @@ QMAKE_CFLAGS_DEBUG += -g
QMAKE_CFLAGS_SHLIB += $$QMAKE_CFLAGS_PIC
QMAKE_CFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_PIC
QMAKE_CFLAGS_APP += $$QMAKE_CFLAGS_PIC
QMAKE_CFLAGS_ISYSTEM = -isystem
QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses
QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
QMAKE_CFLAGS_EXCEPTIONS_OFF += -fno-exceptions

View File

@ -9,7 +9,6 @@ include(../common/icc-base-unix.conf)
# modifications to icc-base-unix.conf
QMAKE_CFLAGS_YACC =
QMAKE_CFLAGS_ISYSTEM = -isystem
QMAKE_CFLAGS_THREAD = -D_REENTRANT
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC

View File

@ -198,18 +198,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
t << "INCPATH =";
{
QString isystem = var("QMAKE_CFLAGS_ISYSTEM");
const ProStringList &incs = project->values("INCLUDEPATH");
for(int i = 0; i < incs.size(); ++i) {
const ProString &inc = incs.at(i);
if (inc.isEmpty())
continue;
if (!isystem.isEmpty() && isSystemInclude(inc.toQString()))
t << ' ' << isystem << ' ';
else
t << " -I";
t << escapeFilePath(inc);
t << " -I" << escapeFilePath(inc);
}
}
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
@ -1393,8 +1388,7 @@ void UnixMakefileGenerator::init2()
}
if (include_deps && project->isActiveConfig("gcc_MD_depends")) {
// use -MMD if we know about -isystem too
ProString MD_flag(project->values("QMAKE_CFLAGS_ISYSTEM").isEmpty() ? "-MD" : "-MMD");
ProString MD_flag("-MD");
project->values("QMAKE_CFLAGS") += MD_flag;
project->values("QMAKE_CXXFLAGS") += MD_flag;
}

View File

@ -200,17 +200,12 @@ void MingwMakefileGenerator::writeIncPart(QTextStream &t)
{
t << "INCPATH = ";
QString isystem = var("QMAKE_CFLAGS_ISYSTEM");
const ProStringList &incs = project->values("INCLUDEPATH");
for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) {
QString inc = (*incit).toQString();
inc.replace(QRegularExpression("\\\\$"), "");
if (!isystem.isEmpty() && isSystemInclude(inc))
t << isystem << ' ';
else
t << "-I";
t << escapeFilePath(inc) << ' ';
t << "-I" << escapeFilePath(inc) << ' ';
}
t << Qt::endl;
}