forked from qt-creator/qt-creator
CppTools: ProjectPart now collects warning flags
Will be used by ClangCodeModel, but native model also can use it by disabling unused variable/parameter warnings when needed. Change-Id: I184efb3c65e893a2d85a933385cc547b646e6826 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
committed by
Erik Verbruggen
parent
df7347efe3
commit
59b303fadc
@@ -52,6 +52,16 @@
|
||||
using namespace CppTools;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
ProjectPart::ProjectPart()
|
||||
: cVersion(C89)
|
||||
, cxxVersion(CXX11)
|
||||
, cxxExtensions(NoExtensions)
|
||||
, qtVersion(UnknownQt)
|
||||
, cWarningFlags(ProjectExplorer::ToolChain::WarningsDefault)
|
||||
, cxxWarningFlags(ProjectExplorer::ToolChain::WarningsDefault)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves info from concrete compiler using it's flags.
|
||||
* @param tc Either nullptr or toolchain for project's active target.
|
||||
@@ -90,6 +100,9 @@ void ProjectPart::evaluateToolchain(const ToolChain *tc,
|
||||
if (cxx | ToolChain::OpenMP)
|
||||
cxxExtensions |= OpenMP;
|
||||
|
||||
cWarningFlags = tc->warningFlags(cflags);
|
||||
cxxWarningFlags = tc->warningFlags(cxxflags);
|
||||
|
||||
QList<HeaderPath> headers = tc->systemHeaderPaths(cxxflags, sysRoot);
|
||||
foreach (const HeaderPath &header, headers)
|
||||
if (header.kind() == HeaderPath::FrameworkHeaderPath)
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "cppprojectfile.h"
|
||||
|
||||
#include <cplusplus/CppDocument.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QHash>
|
||||
@@ -43,10 +44,7 @@
|
||||
|
||||
namespace Core { class IEditor; }
|
||||
namespace CPlusPlus { class LookupContext; }
|
||||
namespace ProjectExplorer {
|
||||
class Project;
|
||||
class ToolChain;
|
||||
}
|
||||
namespace ProjectExplorer { class Project; }
|
||||
namespace TextEditor { class BaseTextEditor; }
|
||||
namespace Utils { class FileName; }
|
||||
|
||||
@@ -62,12 +60,7 @@ class CppIndexingSupport;
|
||||
class CPPTOOLS_EXPORT ProjectPart
|
||||
{
|
||||
public:
|
||||
ProjectPart()
|
||||
: cVersion(C89)
|
||||
, cxxVersion(CXX11)
|
||||
, cxxExtensions(NoExtensions)
|
||||
, qtVersion(UnknownQt)
|
||||
{}
|
||||
ProjectPart();
|
||||
|
||||
void evaluateToolchain(const ProjectExplorer::ToolChain *tc,
|
||||
const QStringList &cxxflags,
|
||||
@@ -114,6 +107,8 @@ public: //attributes
|
||||
CXXVersion cxxVersion;
|
||||
CXXExtensions cxxExtensions;
|
||||
QtVersion qtVersion;
|
||||
ProjectExplorer::ToolChain::WarningFlags cWarningFlags;
|
||||
ProjectExplorer::ToolChain::WarningFlags cxxWarningFlags;
|
||||
};
|
||||
|
||||
class CPPTOOLS_EXPORT CppModelManagerInterface : public QObject
|
||||
|
||||
Reference in New Issue
Block a user