diff options
author | Ivan Komissarov <abbapoh@gmail.com> | 2020-02-23 17:59:57 +0100 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2020-03-09 10:13:15 +0000 |
commit | 1b3f4b0ac80c0b66eef2c03df4c4385044aa7ba6 (patch) | |
tree | 1dabf07cc3f30f42f97272818c83ab61b3e2fe51 /tests/auto/shared.h | |
parent | 16e4b2e6d6a3bce11ce7e021c1fb40194e3fb8dd (diff) | |
download | qbs-1b3f4b0ac80c0b66eef2c03df4c4385044aa7ba6.tar.gz |
setup-toolchains now sets the qbs.toolchainType, not qbs.toolchain
Change-Id: I21f0626a093db358f8f5dfa6248672c44edc82e2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests/auto/shared.h')
-rw-r--r-- | tests/auto/shared.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/auto/shared.h b/tests/auto/shared.h index ac950f12a..beda8fff3 100644 --- a/tests/auto/shared.h +++ b/tests/auto/shared.h @@ -31,6 +31,7 @@ #include <tools/hostosinfo.h> #include <tools/profile.h> #include <tools/settings.h> +#include <tools/toolchains.h> #include <QtCore/qbytearray.h> #include <QtCore/qcryptographichash.h> @@ -270,14 +271,22 @@ inline void copyFileAndUpdateTimestamp(const QString &source, const QString &tar touch(target); } +inline QStringList profileToolchain(const qbs::Profile &profile) +{ + const auto toolchainType = profile.value(QStringLiteral("qbs.toolchainType")).toString(); + if (!toolchainType.isEmpty()) + return qbs::canonicalToolchain(toolchainType); + return profile.value(QStringLiteral("qbs.toolchain")).toStringList(); +} + inline QString objectFileName(const QString &baseName, const QString &profileName) { const SettingsPtr s = settings(); qbs::Profile profile(profileName, s.get()); - const auto tc = profile.value("qbs.toolchainType").toString(); - const auto tcList = profile.value("qbs.toolchain").toStringList(); - const bool isMsvc = tc == "msvc" || tcList.contains("msvc") - || (tc.isEmpty() && tcList.isEmpty() && qbs::Internal::HostOsInfo::isWindowsHost()); + + const auto tcList = profileToolchain(profile); + const bool isMsvc = tcList.contains("msvc") + || (tcList.isEmpty() && qbs::Internal::HostOsInfo::isWindowsHost()); const QString suffix = isMsvc ? "obj" : "o"; return baseName + '.' + suffix; } |