CppTools: Allow interpreting ambiguous headers as C headers

...instead of C++ headers.

For the Clang Code Model this results in using "-x c-header" instead of
"-x c++-header".

This introduces a new option in Options > C++ > "Code Model" to
configure this.

Change-Id: I8a0ce8fa6155f5ef58743ebc7f1d0b500fbf6599
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Nikolai Kosjar
2017-01-12 18:01:12 +01:00
parent 4416eecc02
commit e4e6572661
21 changed files with 228 additions and 72 deletions

View File

@@ -25,6 +25,7 @@
#pragma once
#include "cpplanguage.h"
#include "cpptools_global.h"
#include "cppworkingcopy.h"
#include "projectpart.h"
@@ -55,15 +56,18 @@ public:
struct UpdateParams {
UpdateParams(const WorkingCopy &workingCopy,
const ProjectExplorer::Project *activeProject,
Language languagePreference,
bool hasActiveProjectChanged)
: workingCopy(workingCopy)
, activeProject(activeProject)
, languagePreference(languagePreference)
, hasActiveProjectChanged(hasActiveProjectChanged)
{
}
WorkingCopy workingCopy;
const ProjectExplorer::Project *activeProject = nullptr;
Language languagePreference = Language::Cxx;
bool hasActiveProjectChanged = false;
};
@@ -92,6 +96,7 @@ protected:
const Configuration &config,
const State &state,
const ProjectExplorer::Project *activeProject,
Language languagePreference,
bool hasActiveProjectChanged);
mutable QMutex m_stateAndConfigurationMutex;