Skip to content

Commit

Permalink
qmake: Stop using -isystem flag
Browse files Browse the repository at this point in the history
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.

Additional change added when cherry-picking: build the GTK platformtheme
with -Wno-error=parentheses flag, to fix GCC errors with GTK < 3.23.

Change-Id: I80eeabd09764df290b60bc59aeb2f90d07723608
Reviewed-by: Thiago Macieira <[email protected]>
(cherry picked from commit f133b22)
  • Loading branch information
mitya57 committed Jun 25, 2020
1 parent 6afc56e commit a5dd0b4
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 17 deletions.
1 change: 0 additions & 1 deletion mkspecs/common/clang.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion mkspecs/common/gcc-base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion mkspecs/linux-icc/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 2 additions & 8 deletions qmake/generators/unix/unixmake2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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;
}
Expand Down
7 changes: 1 addition & 6 deletions qmake/generators/win32/mingw_make.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(QRegExp("\\\\$"), "");

if (!isystem.isEmpty() && isSystemInclude(inc))
t << isystem << ' ';
else
t << "-I";
t << escapeFilePath(inc) << ' ';
t << "-I" << escapeFilePath(inc) << ' ';
}
t << Qt::endl;
}
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/platformthemes/gtk3/gtk3.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ QT += core-private gui-private theme_support-private
CONFIG += X11
QMAKE_USE += gtk3
DEFINES += GDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_6
# Needed for GTK < 3.23
QMAKE_CXXFLAGS_WARN_ON += -Wno-error=parentheses

HEADERS += \
qgtk3dialoghelpers.h \
Expand Down

0 comments on commit a5dd0b4

Please sign in to comment.