CppEditor: Fix codemodel highlighting for QNX

The code model will get the necessary bits so that it can successfully
parse the QNX code.

Fixes: QTCREATORBUG-23483
Change-Id: Id9488f644ace23952edf7a7cb5da7ca138182134
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Cristian Adam
2021-12-03 13:52:21 +01:00
parent 41fe7eec65
commit 5a6c625c5e
3 changed files with 25 additions and 3 deletions

View File

@@ -185,7 +185,13 @@ void QnxToolChain::setCpuDir(const QString &cpuDir)
GccToolChain::DetectedAbisResult QnxToolChain::detectSupportedAbis() const
{
return detectTargetAbis(m_sdpPath);
// "unknown-qnx-gnu"is needed to get the "--target=xxx" parameter sent code model,
// which gets translated as "x86_64-qnx-gnu", which gets Clang to happily parse
// the QNX code.
//
// Without it on Windows Clang defaults to a MSVC mode, which breaks with
// the QNX code, which is mostly GNU based.
return GccToolChain::DetectedAbisResult{detectTargetAbis(m_sdpPath), "unknown-qnx-gnu"};
}
bool QnxToolChain::operator ==(const ToolChain &other) const