CppEditor: Consider project part language

... when creating compiler command line for header files.
In particular, make sure we do not use "objective-c++-header" for
Objective-C headers in a C project part.

Fixes: QTCREATORBUG-28368
Change-Id: I1e5067a939e037df53a318af2b15dec7295fcd46
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2022-10-27 16:31:23 +02:00
parent 134c84b502
commit 3c61470cb8
3 changed files with 14 additions and 15 deletions

View File

@@ -125,7 +125,7 @@ static QJsonObject createFileObject(const FilePath &buildDir,
args.append("/TP");
} else {
QStringList langOption
= createLanguageOptionGcc(kind,
= createLanguageOptionGcc(projectPart.language, kind,
projectPart.languageExtensions
& LanguageExtension::ObjectiveC);
for (const QString &langOptionPart : langOption)