aboutsummaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-09-12 22:02:05 -0700
committerJake Petroules <jake.petroules@qt.io>2017-09-13 09:23:38 +0000
commit6dc53c497d196700bfd3b47570b5f43d9fd2a0a6 (patch)
tree41e1e12e48e06d0c5b96a0e9042647b8ac41e5d5 /src/app
parent4ba79af3bb8ba4bc21fc857b5f8863f099c88fee (diff)
Fix bogus warning about missing objcopy in setup-toolchains on macOS
Task-number: QBS-1192 Change-Id: I517b08100cea0154372b6b2fd7a9ac10778a7358 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/app')
-rw-r--r--src/app/qbs-setup-toolchains/probe.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/app/qbs-setup-toolchains/probe.cpp b/src/app/qbs-setup-toolchains/probe.cpp
index 735285718..2bb99abfd 100644
--- a/src/app/qbs-setup-toolchains/probe.cpp
+++ b/src/app/qbs-setup-toolchains/probe.cpp
@@ -48,6 +48,7 @@
#include <tools/profile.h>
#include <tools/settings.h>
#include <tools/toolchains.h>
+#include <tools/stlutils.h>
#include <QtCore/qdir.h>
#include <QtCore/qfileinfo.h>
@@ -185,6 +186,17 @@ private:
QString m_toolchainPrefix;
};
+static bool doesProfileTargetOS(const Profile &profile, const QString &os)
+{
+ const auto target = profile.value(QStringLiteral("qbs.targetOS"));
+ if (target.isValid())
+ return target.toStringList().contains(os);
+ const auto host = profile.value(QStringLiteral("qbs.hostOS"));
+ if (host.isValid())
+ return host.toStringList().contains(os);
+ return Internal::contains(HostOsInfo::hostOSIdentifiers(), os.toStdString());
+}
+
static Profile createGccProfile(const QString &compilerFilePath, Settings *settings,
const QStringList &toolchainTypes,
const QString &profileName = QString())
@@ -211,8 +223,7 @@ static Profile createGccProfile(const QString &compilerFilePath, Settings *setti
toolPathSetup.apply(QLatin1String("ar"), QLatin1String("cpp.archiverPath"));
toolPathSetup.apply(QLatin1String("as"), QLatin1String("cpp.assemblerPath"));
toolPathSetup.apply(QLatin1String("nm"), QLatin1String("cpp.nmPath"));
- if (profile.value(QStringLiteral("qbs.targetOS"))
- .toStringList().contains(QStringLiteral("darwin")))
+ if (doesProfileTargetOS(profile, QStringLiteral("darwin")))
toolPathSetup.apply(QLatin1String("dsymutil"), QLatin1String("cpp.dsymutilPath"));
else
toolPathSetup.apply(QLatin1String("objcopy"), QLatin1String("cpp.objcopyPath"));