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>
This commit is contained in:
Christian Kandeler
2022-11-28 12:28:54 +01:00
parent a146403596
commit aed633712f
4 changed files with 13 additions and 6 deletions

View File

@@ -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,