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:
parent
ee63557112
commit
f133b226cd
@ -18,7 +18,6 @@ QMAKE_PCH_OUTPUT_EXT = .pch
|
|||||||
|
|
||||||
QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz
|
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_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_USE_PRECOMPILE = -Xclang -include-pch -Xclang ${QMAKE_PCH_OUTPUT}
|
||||||
QMAKE_CFLAGS_LTCG = -flto=thin
|
QMAKE_CFLAGS_LTCG = -flto=thin
|
||||||
|
@ -46,7 +46,6 @@ QMAKE_CFLAGS_DEBUG += -g
|
|||||||
QMAKE_CFLAGS_SHLIB += $$QMAKE_CFLAGS_PIC
|
QMAKE_CFLAGS_SHLIB += $$QMAKE_CFLAGS_PIC
|
||||||
QMAKE_CFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_PIC
|
QMAKE_CFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_PIC
|
||||||
QMAKE_CFLAGS_APP += $$QMAKE_CFLAGS_PIC
|
QMAKE_CFLAGS_APP += $$QMAKE_CFLAGS_PIC
|
||||||
QMAKE_CFLAGS_ISYSTEM = -isystem
|
|
||||||
QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses
|
QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses
|
||||||
QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
|
QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
|
||||||
QMAKE_CFLAGS_EXCEPTIONS_OFF += -fno-exceptions
|
QMAKE_CFLAGS_EXCEPTIONS_OFF += -fno-exceptions
|
||||||
|
@ -9,7 +9,6 @@ include(../common/icc-base-unix.conf)
|
|||||||
# modifications to icc-base-unix.conf
|
# modifications to icc-base-unix.conf
|
||||||
|
|
||||||
QMAKE_CFLAGS_YACC =
|
QMAKE_CFLAGS_YACC =
|
||||||
QMAKE_CFLAGS_ISYSTEM = -isystem
|
|
||||||
QMAKE_CFLAGS_THREAD = -D_REENTRANT
|
QMAKE_CFLAGS_THREAD = -D_REENTRANT
|
||||||
|
|
||||||
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
|
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
|
||||||
|
@ -198,18 +198,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
|
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
|
||||||
t << "INCPATH =";
|
t << "INCPATH =";
|
||||||
{
|
{
|
||||||
QString isystem = var("QMAKE_CFLAGS_ISYSTEM");
|
|
||||||
const ProStringList &incs = project->values("INCLUDEPATH");
|
const ProStringList &incs = project->values("INCLUDEPATH");
|
||||||
for(int i = 0; i < incs.size(); ++i) {
|
for(int i = 0; i < incs.size(); ++i) {
|
||||||
const ProString &inc = incs.at(i);
|
const ProString &inc = incs.at(i);
|
||||||
if (inc.isEmpty())
|
if (inc.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!isystem.isEmpty() && isSystemInclude(inc.toQString()))
|
t << " -I" << escapeFilePath(inc);
|
||||||
t << ' ' << isystem << ' ';
|
|
||||||
else
|
|
||||||
t << " -I";
|
|
||||||
t << escapeFilePath(inc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
|
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
|
||||||
@ -1393,8 +1388,7 @@ void UnixMakefileGenerator::init2()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (include_deps && project->isActiveConfig("gcc_MD_depends")) {
|
if (include_deps && project->isActiveConfig("gcc_MD_depends")) {
|
||||||
// use -MMD if we know about -isystem too
|
ProString MD_flag("-MD");
|
||||||
ProString MD_flag(project->values("QMAKE_CFLAGS_ISYSTEM").isEmpty() ? "-MD" : "-MMD");
|
|
||||||
project->values("QMAKE_CFLAGS") += MD_flag;
|
project->values("QMAKE_CFLAGS") += MD_flag;
|
||||||
project->values("QMAKE_CXXFLAGS") += MD_flag;
|
project->values("QMAKE_CXXFLAGS") += MD_flag;
|
||||||
}
|
}
|
||||||
|
@ -200,17 +200,12 @@ void MingwMakefileGenerator::writeIncPart(QTextStream &t)
|
|||||||
{
|
{
|
||||||
t << "INCPATH = ";
|
t << "INCPATH = ";
|
||||||
|
|
||||||
QString isystem = var("QMAKE_CFLAGS_ISYSTEM");
|
|
||||||
const ProStringList &incs = project->values("INCLUDEPATH");
|
const ProStringList &incs = project->values("INCLUDEPATH");
|
||||||
for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) {
|
for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) {
|
||||||
QString inc = (*incit).toQString();
|
QString inc = (*incit).toQString();
|
||||||
inc.replace(QRegularExpression("\\\\$"), "");
|
inc.replace(QRegularExpression("\\\\$"), "");
|
||||||
|
|
||||||
if (!isystem.isEmpty() && isSystemInclude(inc))
|
t << "-I" << escapeFilePath(inc) << ' ';
|
||||||
t << isystem << ' ';
|
|
||||||
else
|
|
||||||
t << "-I";
|
|
||||||
t << escapeFilePath(inc) << ' ';
|
|
||||||
}
|
}
|
||||||
t << Qt::endl;
|
t << Qt::endl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user