From 150d53e04139879ecea88d39cfa3a88eaf4da5f4 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Fri, 25 May 2018 14:18:33 +0200 Subject: Clang: Use QFileInfo instead of QDir for clang executable path QDir::exists() returns false for files which is not the intended behavior. Change-Id: I768432df93e10b3f8f570da4d94035038ff52e06 Reviewed-by: Nikolai Kosjar --- src/plugins/cpptools/compileroptionsbuilder.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index d6921b07ff..a2ed615894 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -565,10 +565,10 @@ QString clangIncludeDirectory(const QString &clangVersion, const QString &clangR QString clangExecutable(const QString &clangBinDirectory) { const QString hostExeSuffix(QTC_HOST_EXE_SUFFIX); - QDir executable(creatorLibexecPath() + "/clang/bin/clang" + hostExeSuffix); + QFileInfo executable(creatorLibexecPath() + "/clang/bin/clang" + hostExeSuffix); if (!executable.exists()) - executable = QDir(clangBinDirectory + "/clang" + hostExeSuffix); - return QDir::toNativeSeparators(executable.canonicalPath()); + executable = QFileInfo(clangBinDirectory + "/clang" + hostExeSuffix); + return QDir::toNativeSeparators(executable.canonicalFilePath()); } void CompilerOptionsBuilder::undefineClangVersionMacrosForMsvc() -- cgit v1.2.1