From bed1dab265a24a812d1c5c9df92a1c38939937a3 Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Sun, 3 Oct 2021 23:46:40 +0800 Subject: [PATCH] - implement: correctly recognize clang (msys2 build) --- NEWS.md | 1 + RedPandaIDE/settings.cpp | 79 ++++++++++++++++++++++++++-------------- RedPandaIDE/settings.h | 5 +++ 3 files changed, 58 insertions(+), 27 deletions(-) diff --git a/NEWS.md b/NEWS.md index 5f40256c..a93ec0fb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,6 +6,7 @@ Version 0.6.0 - change: auto open a new editor at start - enhancement: todo view - add: about dialog + - implement: correctly recognize clang (msys2 build) Version 0.5.0 - enhancement: support C++ using type alias; diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 4ed38a30..99a1435b 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -1282,6 +1282,7 @@ Settings::CompilerSet::CompilerSet(const Settings::CompilerSet &set): mName(set.mName), mDefines(set.mDefines), mTarget(set.mTarget), + mCompilerType(set.mCompilerType), mUseCustomCompileParams(set.mUseCustomCompileParams), mUseCustomLinkParams(set.mUseCustomLinkParams), mCustomCompileParams(set.mCustomCompileParams), @@ -1726,36 +1727,50 @@ void Settings::CompilerSet::setProperties(const QString &binDir) mTarget = "i686"; //Find version number - targetStr = "gcc version "; + targetStr = "clang version "; delimPos1 = output.indexOf(targetStr); - if (delimPos1<0) - return; // unknown binary - delimPos1+=strlen(targetStr); - delimPos2 = delimPos1; - while (delimPos2=0) { + mCompilerType = "Clang"; + delimPos1+=strlen(targetStr); + delimPos2 = delimPos1; + while (delimPos2