summaryrefslogtreecommitdiff
path: root/src/plugins/clangcodemodel/clangutils.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2022-11-28 12:28:54 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2022-11-28 12:32:41 +0000
commitaed633712fdd85aa4f7a72794f976eb5603d3821 (patch)
tree227f14a3877ec4bd4597e823545711724b88062d /src/plugins/clangcodemodel/clangutils.cpp
parenta1464035962dfcf871773c28216f79ad228b26a0 (diff)
downloadqt-creator-aed633712fdd85aa4f7a72794f976eb5603d3821.tar.gz
CppEditor: Prevent /TC and /TP with Objective-C files
This is relevant when clang-cl is used to compile Objective-C projects. Task-number: QTCREATORBUG-28369 Change-Id: If8ae4dfaa07bf2ec81fbbec358663617c430b9e2 Reviewed-by: Frederik Seiffert <frederik@algoriddim.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/clangcodemodel/clangutils.cpp')
-rw-r--r--src/plugins/clangcodemodel/clangutils.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp
index c250c9b460..0780b1cae3 100644
--- a/src/plugins/clangcodemodel/clangutils.cpp
+++ b/src/plugins/clangcodemodel/clangutils.cpp
@@ -119,10 +119,12 @@ static QJsonObject createFileObject(const FilePath &buildDir,
const ProjectFile::Kind kind = ProjectFile::classify(projFile.path);
if (projectPart.toolchainType == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID
|| projectPart.toolchainType == ProjectExplorer::Constants::CLANG_CL_TOOLCHAIN_TYPEID) {
- if (ProjectFile::isC(kind))
- args.append("/TC");
- else if (ProjectFile::isCxx(kind))
- args.append("/TP");
+ if (!ProjectFile::isObjC(kind)) {
+ if (ProjectFile::isC(kind))
+ args.append("/TC");
+ else if (ProjectFile::isCxx(kind))
+ args.append("/TP");
+ }
} else {
QStringList langOption
= createLanguageOptionGcc(projectPart.language, kind,