diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 09788612a8f3dfd1a078cf45e6ba49b70492d15e..3405c41309361713c82068e60985e7294bfe5c4e 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -374,8 +374,10 @@ QByteArray GccToolChain::predefinedMacros(const QStringList &cxxflags) const QStringList arguments = gccPredefinedMacrosOptions(); for (int iArg = 0; iArg < allCxxflags.length(); ++iArg) { const QString &a = allCxxflags.at(iArg); - if (a == QLatin1String("-arch") || a == QLatin1String("--sysroot") - || a == QLatin1String("-isysroot")) { + if (a == QLatin1String("-arch")) { + if (++iArg < allCxxflags.length() && !arguments.contains(a)) + arguments << a << allCxxflags.at(iArg); + } else if (a == QLatin1String("--sysroot") || a == QLatin1String("-isysroot")) { if (++iArg < allCxxflags.length()) arguments << a << allCxxflags.at(iArg); } else if (a == QLatin1String("-m128bit-long-double") || a == QLatin1String("-m32")