diff options
author | Alberto Mardegan <mardy@users.sourceforge.net> | 2020-04-12 10:11:47 +0300 |
---|---|---|
committer | Alberto Mardegan <mardy@users.sourceforge.net> | 2020-04-15 16:07:54 +0000 |
commit | 846fc574f38395af24a9e60726372cb56075cff4 (patch) | |
tree | 51cbad18794986afd53b06fa4cda4da45f7aaad9 /src/lib | |
parent | 8ceb1028659f9f5f921195192cafef9791f29682 (diff) |
GCC: fix detection of Mingw prefix in MXE
The toolchain paths in MXE are of the form
$MXE_PATH/usr/bin/x86_64-w64-mingw32.shared-g++
so we should not assume that what follows the dot is an extension that
needs to be stripped (like QFileInfo::completeBaseName() does). Instead,
only strip the know executable extensions.
Change-Id: I51040d65e372ef3152ddd9229dd33011661c2b46
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Richard Weickelt <richard@weickelt.de>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/corelib/tools/hostosinfo.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/corelib/tools/hostosinfo.h b/src/lib/corelib/tools/hostosinfo.h index 42ce3f8cf..0876d39ec 100644 --- a/src/lib/corelib/tools/hostosinfo.h +++ b/src/lib/corelib/tools/hostosinfo.h @@ -112,6 +112,13 @@ public: return finalName; } + static QString stripExecutableSuffix(const QString &executable) + { + constexpr QLatin1String suffix(QBS_HOST_EXE_SUFFIX, sizeof(QBS_HOST_EXE_SUFFIX) - 1); + return !suffix.isEmpty() && executable.endsWith(suffix) + ? executable.chopped(suffix.size()) : executable; + } + static QString dynamicLibraryName(const QString &libraryBaseName) { return QLatin1String(QBS_HOST_DYNAMICLIB_PREFIX) + libraryBaseName |