diff options
Diffstat (limited to 'src/app/qbs-setup-toolchains/clangclprobe.cpp')
-rw-r--r-- | src/app/qbs-setup-toolchains/clangclprobe.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/app/qbs-setup-toolchains/clangclprobe.cpp b/src/app/qbs-setup-toolchains/clangclprobe.cpp index 5c2a87731..816d28546 100644 --- a/src/app/qbs-setup-toolchains/clangclprobe.cpp +++ b/src/app/qbs-setup-toolchains/clangclprobe.cpp @@ -60,9 +60,9 @@ using qbs::Internal::Tr; namespace { -QString getToolchainInstallPath(const QString &compilerFilePath) +QString getToolchainInstallPath(const QFileInfo &compiler) { - return QFileInfo(compilerFilePath).path(); // 1 level up + return compiler.path(); // 1 level up } Profile createProfileHelper( @@ -159,19 +159,19 @@ QString findClangCl() } // namespace -void createClangClProfile( - const QString &profileName, const QString &compilerFilePath, Settings *settings) +void createClangClProfile(const QFileInfo &compiler, Settings *settings, + const QString &profileName) { const auto compilerName = QStringLiteral("clang-cl"); const auto vcvarsallPath = findCompatibleVcsarsallBat(); if (vcvarsallPath.isEmpty()) { qbsWarning() << Tr::tr("%1 requires installed Visual Studio 2017 or newer, but none was found.") - .arg(compilerName); + .arg(compilerName); return; } - const auto toolchainInstallPath = getToolchainInstallPath(compilerFilePath); + const auto toolchainInstallPath = getToolchainInstallPath(compiler); const auto hostArch = QString::fromStdString(HostOsInfo::hostOSArchitecture()); createProfileHelper(settings, profileName, toolchainInstallPath, vcvarsallPath, hostArch); } @@ -184,12 +184,12 @@ void clangClProbe(Settings *settings, QList<Profile> &profiles) { const auto compilerName = QStringLiteral("clang-cl"); qbsInfo() << Tr::tr("Trying to detect %1...").arg(compilerName); - const auto compilerFilePath = findClangCl(); + const QString compilerFilePath = findClangCl(); if (compilerFilePath.isEmpty()) { qbsInfo() << Tr::tr("%1 was not found.").arg(compilerName); return; } - + const QFileInfo compiler(compilerFilePath); const auto vcvarsallPath = findCompatibleVcsarsallBat(); if (vcvarsallPath.isEmpty()) { qbsWarning() @@ -202,7 +202,7 @@ void clangClProbe(Settings *settings, QList<Profile> &profiles) QStringLiteral("x86_64"), QStringLiteral("x86") }; - const auto toolchainInstallPath = getToolchainInstallPath(compilerFilePath); + const auto toolchainInstallPath = getToolchainInstallPath(compiler); for (const auto &arch: architectures) { const auto profileName = QStringLiteral("clang-cl-%1").arg(arch); auto profile = createProfileHelper( |