Commit e42bf6eb authored by Marco Bubke's avatar Marco Bubke

CppTools: Remove all references to the tool chain in the project part

Change-Id: I5fd55eadf94c8a185c2082b93b27bf4432e5cabf
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent 77b4b479
......@@ -25,8 +25,6 @@
#include "projectpart.h"
#include <projectexplorer/headerpath.h>
#include <QDir>
#include <QTextStream>
......@@ -37,78 +35,11 @@ ProjectPart::ProjectPart()
, languageVersion(CXX14)
, languageExtensions(NoExtensions)
, qtVersion(UnknownQt)
, warningFlags(ProjectExplorer::ToolChain::WarningsDefault)
, warningFlags(ProjectExplorer::WarningFlags::Default)
, selectedForBuilding(true)
{
}
static ProjectPartHeaderPath toProjectPartHeaderPath(const ProjectExplorer::HeaderPath &headerPath)
{
const ProjectPartHeaderPath::Type headerPathType =
headerPath.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath
? ProjectPartHeaderPath::FrameworkPath
: ProjectPartHeaderPath::IncludePath;
return ProjectPartHeaderPath(headerPath.path(), headerPathType);
}
/*!
\brief Retrieves info from concrete compiler using it's flags.
\param tc Either nullptr or toolchain for project's active target.
\param cxxflags C++ or Objective-C++ flags.
\param cflags C or ObjectiveC flags if possible, \a cxxflags otherwise.
*/
void ProjectPart::evaluateToolchain(const ProjectExplorer::ToolChain *tc,
const QStringList &commandLineFlags,
const Utils::FileName &sysRoot)
{
if (!tc)
return;
using namespace ProjectExplorer;
ToolChain::CompilerFlags flags = tc->compilerFlags(commandLineFlags);
if (flags & ToolChain::StandardC11)
languageVersion = C11;
else if (flags & ToolChain::StandardC99)
languageVersion = C99;
else if (flags & ToolChain::StandardCxx17)
languageVersion = CXX17;
else if (flags & ToolChain::StandardCxx14)
languageVersion = CXX14;
else if (flags & ToolChain::StandardCxx11)
languageVersion = CXX11;
else if (flags & ToolChain::StandardCxx98)
languageVersion = CXX98;
else
languageVersion = CXX11;
if (flags & ToolChain::BorlandExtensions)
languageExtensions |= BorlandExtensions;
if (flags & ToolChain::GnuExtensions)
languageExtensions |= GnuExtensions;
if (flags & ToolChain::MicrosoftExtensions)
languageExtensions |= MicrosoftExtensions;
if (flags & ToolChain::OpenMP)
languageExtensions |= OpenMPExtensions;
if (flags & ToolChain::ObjectiveC)
languageExtensions |= ObjectiveCExtensions;
warningFlags = tc->warningFlags(commandLineFlags);
const QList<ProjectExplorer::HeaderPath> headers = tc->systemHeaderPaths(commandLineFlags, sysRoot);
foreach (const ProjectExplorer::HeaderPath &header, headers) {
const ProjectPartHeaderPath headerPath = toProjectPartHeaderPath(header);
if (!headerPaths.contains(headerPath))
headerPaths << headerPath;
}
toolchainDefines = tc->predefinedMacros(commandLineFlags);
toolchainType = tc->typeId();
updateLanguageFeatures();
}
void ProjectPart::updateLanguageFeatures()
{
const bool hasQt = qtVersion != NoQt;
......
......@@ -31,7 +31,7 @@
#include "cppprojectfile.h"
#include "projectpartheaderpath.h"
#include <projectexplorer/toolchain.h>
#include <projectexplorer/projectexplorer_global.h>
#include <coreplugin/id.h>
......@@ -88,10 +88,6 @@ public: // Types
public: // methods
ProjectPart();
void evaluateToolchain(const ProjectExplorer::ToolChain *tc,
const QStringList &commandLineFlags,
const Utils::FileName &sysRoot);
void updateLanguageFeatures();
Ptr copy() const;
......@@ -114,7 +110,7 @@ public: // fields
LanguageExtensions languageExtensions;
CPlusPlus::LanguageFeatures languageFeatures;
QtVersion qtVersion;
ProjectExplorer::ToolChain::WarningFlags warningFlags;
ProjectExplorer::WarningFlags warningFlags;
bool selectedForBuilding;
};
......
......@@ -28,10 +28,12 @@
#include "cppprojectfile.h"
#include "cpptoolsconstants.h"
#include <projectexplorer/headerpath.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <utils/mimetypes/mimedatabase.h>
#include <utils/qtcassert.h>
......@@ -235,6 +237,83 @@ QList<Core::Id> ProjectPartBuilder::createProjectPartsForFiles(const QStringList
return languages;
}
namespace {
ProjectPartHeaderPath toProjectPartHeaderPath(const ProjectExplorer::HeaderPath &headerPath)
{
const ProjectPartHeaderPath::Type headerPathType =
headerPath.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath
? ProjectPartHeaderPath::FrameworkPath
: ProjectPartHeaderPath::IncludePath;
return ProjectPartHeaderPath(headerPath.path(), headerPathType);
}
}
/*!
\brief Retrieves info from concrete compiler using it's flags.
\param projectPart Project part which can never be an null pointer.
\param toolChain Either nullptr or toolchain for project's active target.
\param cxxflags C++ or Objective-C++ flags.
\param cflags C or ObjectiveC flags if possible, \a cxxflags otherwise.
*/
void ProjectPartBuilder::evaluateProjectPartToolchain(
ProjectPart *projectPart,
const ProjectExplorer::ToolChain *toolChain,
const QStringList &commandLineFlags,
const Utils::FileName &sysRoot)
{
if (toolChain == nullptr)
return;
using namespace ProjectExplorer;
ToolChain::CompilerFlags flags = toolChain->compilerFlags(commandLineFlags);
auto &languageVersion = projectPart->languageVersion;
if (flags & ToolChain::StandardC11)
languageVersion = ProjectPart::C11;
else if (flags & ToolChain::StandardC99)
languageVersion = ProjectPart::C99;
else if (flags & ToolChain::StandardCxx17)
languageVersion = ProjectPart::CXX17;
else if (flags & ToolChain::StandardCxx14)
languageVersion = ProjectPart::CXX14;
else if (flags & ToolChain::StandardCxx11)
languageVersion = ProjectPart::CXX11;
else if (flags & ToolChain::StandardCxx98)
languageVersion = ProjectPart::CXX98;
else
languageVersion = ProjectPart::CXX11;
auto &languageExtensions = projectPart->languageExtensions;
if (flags & ToolChain::BorlandExtensions)
languageExtensions |= ProjectPart::BorlandExtensions;
if (flags & ToolChain::GnuExtensions)
languageExtensions |= ProjectPart::GnuExtensions;
if (flags & ToolChain::MicrosoftExtensions)
languageExtensions |= ProjectPart::MicrosoftExtensions;
if (flags & ToolChain::OpenMP)
languageExtensions |= ProjectPart::OpenMPExtensions;
if (flags & ToolChain::ObjectiveC)
languageExtensions |= ProjectPart::ObjectiveCExtensions;
projectPart->warningFlags = toolChain->warningFlags(commandLineFlags);
const QList<ProjectExplorer::HeaderPath> headers = toolChain->systemHeaderPaths(commandLineFlags, sysRoot);
foreach (const ProjectExplorer::HeaderPath &header, headers) {
const ProjectPartHeaderPath headerPath = toProjectPartHeaderPath(header);
if (!projectPart->headerPaths.contains(headerPath))
projectPart->headerPaths.push_back(headerPath);
}
projectPart->toolchainDefines = toolChain->predefinedMacros(commandLineFlags);
projectPart->toolchainType = toolChain->typeId();
projectPart->updateLanguageFeatures();
}
namespace Internal {
class ProjectFileAdder
......@@ -302,7 +381,10 @@ void ProjectPartBuilder::createProjectPart(const QStringList &theSources,
if (ProjectExplorer::ToolChain *toolChain = ProjectExplorer::ToolChainKitInformation::toolChain(kit)) {
const QStringList flags = languageVersion >= ProjectPart::CXX98 ? m_cxxFlags
: m_cFlags;
part->evaluateToolchain(toolChain, flags, ProjectExplorer::SysRootKitInformation::sysRoot(kit));
evaluateProjectPartToolchain(part.data(),
toolChain,
flags,
ProjectExplorer::SysRootKitInformation::sysRoot(kit));
}
}
}
......
......@@ -31,6 +31,10 @@
#include "projectinfo.h"
#include "projectpart.h"
namespace ProjectExplorer {
class ToolChain;
}
namespace CppTools {
class CPPTOOLS_EXPORT ProjectPartBuilder
......@@ -51,6 +55,11 @@ public:
QList<Core::Id> createProjectPartsForFiles(const QStringList &files);
static void evaluateProjectPartToolchain(ProjectPart *projectPart,
const ProjectExplorer::ToolChain *toolChain,
const QStringList &commandLineFlags,
const Utils::FileName &sysRoot);
private:
void createProjectPart(const QStringList &theSources, const QString &partName,
ProjectPart::LanguageVersion languageVersion,
......
......@@ -105,7 +105,7 @@ ToolChain::CompilerFlags AbstractMsvcToolChain::compilerFlags(const QStringList
* Converts MSVC warning flags to clang flags.
* @see http://msdn.microsoft.com/en-us/library/thxezb7y.aspx
*/
AbstractMsvcToolChain::WarningFlags AbstractMsvcToolChain::warningFlags(const QStringList &cflags) const
WarningFlags AbstractMsvcToolChain::warningFlags(const QStringList &cflags) const
{
WarningFlags flags;
foreach (QString flag, cflags) {
......@@ -113,7 +113,7 @@ AbstractMsvcToolChain::WarningFlags AbstractMsvcToolChain::warningFlags(const QS
flag[0] = QLatin1Char('/');
if (flag == QLatin1String("/WX"))
flags |= WarningsAsErrors;
flags |= WarningFlags::AsErrors;
else if (flag == QLatin1String("/W0") || flag == QLatin1String("/w"))
inferWarningsForLevel(0, flags);
else if (flag == QLatin1String("/W1"))
......@@ -127,25 +127,25 @@ AbstractMsvcToolChain::WarningFlags AbstractMsvcToolChain::warningFlags(const QS
if (add.triggered())
continue;
// http://msdn.microsoft.com/en-us/library/ay4h0tc9.aspx
add(4263, WarnOverloadedVirtual);
add(4263, WarningFlags::OverloadedVirtual);
// http://msdn.microsoft.com/en-us/library/ytxde1x7.aspx
add(4230, WarnIgnoredQualfiers);
add(4230, WarningFlags::IgnoredQualfiers);
// not exact match, http://msdn.microsoft.com/en-us/library/0hx5ckb0.aspx
add(4258, WarnHiddenLocals);
add(4258, WarningFlags::HiddenLocals);
// http://msdn.microsoft.com/en-us/library/wzxffy8c.aspx
add(4265, WarnNonVirtualDestructor);
add(4265, WarningFlags::NonVirtualDestructor);
// http://msdn.microsoft.com/en-us/library/y92ktdf2%28v=vs.90%29.aspx
add(4018, WarnSignedComparison);
add(4018, WarningFlags::SignedComparison);
// http://msdn.microsoft.com/en-us/library/w099eeey%28v=vs.90%29.aspx
add(4068, WarnUnknownPragma);
add(4068, WarningFlags::UnknownPragma);
// http://msdn.microsoft.com/en-us/library/26kb9fy0%28v=vs.80%29.aspx
add(4100, WarnUnusedParams);
add(4100, WarningFlags::UnusedParams);
// http://msdn.microsoft.com/en-us/library/c733d5h9%28v=vs.90%29.aspx
add(4101, WarnUnusedLocals);
add(4101, WarningFlags::UnusedLocals);
// http://msdn.microsoft.com/en-us/library/xb1db44s%28v=vs.90%29.aspx
add(4189, WarnUnusedLocals);
add(4189, WarningFlags::UnusedLocals);
// http://msdn.microsoft.com/en-us/library/ttcz0bys%28v=vs.90%29.aspx
add(4996, WarnDeprecated);
add(4996, WarningFlags::Deprecated);
}
return flags;
}
......@@ -336,18 +336,18 @@ bool AbstractMsvcToolChain::generateEnvironmentSettings(Utils::Environment &env,
void AbstractMsvcToolChain::inferWarningsForLevel(int warningLevel, WarningFlags &flags)
{
// reset all except unrelated flag
flags = flags & WarningsAsErrors;
flags = flags & WarningFlags::AsErrors;
if (warningLevel >= 1)
flags |= WarningFlags(WarningsDefault | WarnIgnoredQualfiers | WarnHiddenLocals | WarnUnknownPragma);
flags |= WarningFlags(WarningFlags::Default | WarningFlags::IgnoredQualfiers | WarningFlags::HiddenLocals | WarningFlags::UnknownPragma);
if (warningLevel >= 2)
flags |= WarningsAll;
flags |= WarningFlags::All;
if (warningLevel >= 3) {
flags |= WarningFlags(WarningsExtra | WarnNonVirtualDestructor | WarnSignedComparison
| WarnUnusedLocals | WarnDeprecated);
flags |= WarningFlags(WarningFlags::Extra | WarningFlags::NonVirtualDestructor | WarningFlags::SignedComparison
| WarningFlags::UnusedLocals | WarningFlags::Deprecated);
}
if (warningLevel >= 4)
flags |= WarnUnusedParams;
flags |= WarningFlags::UnusedParams;
}
bool AbstractMsvcToolChain::operator ==(const ToolChain &other) const
......@@ -361,7 +361,7 @@ bool AbstractMsvcToolChain::operator ==(const ToolChain &other) const
}
AbstractMsvcToolChain::WarningFlagAdder::WarningFlagAdder(const QString &flag,
ToolChain::WarningFlags &flags) :
WarningFlags &flags) :
m_flags(flags),
m_triggered(false)
{
......@@ -382,7 +382,7 @@ AbstractMsvcToolChain::WarningFlagAdder::WarningFlagAdder(const QString &flag,
m_triggered = true;
}
void AbstractMsvcToolChain::WarningFlagAdder::operator ()(int warningCode, ToolChain::WarningFlags flagsSet)
void AbstractMsvcToolChain::WarningFlagAdder::operator ()(int warningCode, WarningFlags flagsSet)
{
if (m_triggered)
return;
......@@ -396,11 +396,6 @@ void AbstractMsvcToolChain::WarningFlagAdder::operator ()(int warningCode, ToolC
}
}
void AbstractMsvcToolChain::WarningFlagAdder::operator ()(int warningCode, ToolChain::WarningFlag flag)
{
(*this)(warningCode, WarningFlags(flag));
}
bool AbstractMsvcToolChain::WarningFlagAdder::triggered() const
{
return m_triggered;
......
......@@ -78,7 +78,6 @@ protected:
public:
WarningFlagAdder(const QString &flag, WarningFlags &flags);
void operator ()(int warningCode, WarningFlags flagsSet);
void operator ()(int warningCode, WarningFlag flag);
bool triggered() const;
};
......
......@@ -151,10 +151,10 @@ ToolChain::CompilerFlags CustomToolChain::compilerFlags(const QStringList &cxxfl
return NoFlags;
}
ToolChain::WarningFlags CustomToolChain::warningFlags(const QStringList &cxxflags) const
WarningFlags CustomToolChain::warningFlags(const QStringList &cxxflags) const
{
Q_UNUSED(cxxflags);
return WarningFlags(WarningsDefault);
return WarningFlags::Default;
}
const QStringList &CustomToolChain::rawPredefinedMacros() const
......
......@@ -476,15 +476,15 @@ ToolChain::CompilerFlags GccToolChain::compilerFlags(const QStringList &cxxflags
return flags;
}
GccToolChain::WarningFlags GccToolChain::warningFlags(const QStringList &cflags) const
WarningFlags GccToolChain::warningFlags(const QStringList &cflags) const
{
// based on 'LC_ALL="en" gcc -Q --help=warnings | grep enabled'
WarningFlags flags(WarnDeprecated | WarnIgnoredQualfiers
| WarnSignedComparison | WarnUninitializedVars);
WarningFlags groupWall(WarningsAll | WarnUnknownPragma |WarnUnusedFunctions
| WarnUnusedLocals | WarnUnusedResult | WarnUnusedValue
| WarnSignedComparison | WarnUninitializedVars);
WarningFlags groupWextra(WarningsExtra | WarnIgnoredQualfiers | WarnUnusedParams);
WarningFlags flags(WarningFlags::Deprecated | WarningFlags::IgnoredQualfiers
| WarningFlags::SignedComparison | WarningFlags::UninitializedVars);
WarningFlags groupWall(WarningFlags::All | WarningFlags::UnknownPragma | WarningFlags::UnusedFunctions
| WarningFlags::UnusedLocals | WarningFlags::UnusedResult | WarningFlags::UnusedValue
| WarningFlags::SignedComparison | WarningFlags::UninitializedVars);
WarningFlags groupWextra(WarningFlags::Extra | WarningFlags::IgnoredQualfiers | WarningFlags::UnusedParams);
foreach (const QString &flag, cflags) {
if (flag == QLatin1String("--all-warnings"))
......@@ -497,26 +497,25 @@ GccToolChain::WarningFlags GccToolChain::warningFlags(const QStringList &cflags)
continue;
// supported by clang too
add("error", WarningsAsErrors);
add("error", WarningFlags::AsErrors);
add("all", groupWall);
add("extra", groupWextra);
add("deprecated", WarnDeprecated);
add("effc++", WarnEffectiveCxx);
add("ignored-qualifiers", WarnIgnoredQualfiers);
add("non-virtual-dtor", WarnNonVirtualDestructor);
add("overloaded-virtual", WarnOverloadedVirtual);
add("shadow", WarnHiddenLocals);
add("sign-compare", WarnSignedComparison);
add("unknown-pragmas", WarnUnknownPragma);
add("unused", ToolChain::WarningFlag(
WarnUnusedFunctions | WarnUnusedLocals | WarnUnusedParams
| WarnUnusedResult | WarnUnusedValue));
add("unused-function", WarnUnusedFunctions);
add("unused-variable", WarnUnusedLocals);
add("unused-parameter", WarnUnusedParams);
add("unused-result", WarnUnusedResult);
add("unused-value", WarnUnusedValue);
add("uninitialized", WarnUninitializedVars);
add("deprecated", WarningFlags::Deprecated);
add("effc++", WarningFlags::EffectiveCxx);
add("ignored-qualifiers", WarningFlags::IgnoredQualfiers);
add("non-virtual-dtor", WarningFlags::NonVirtualDestructor);
add("overloaded-virtual", WarningFlags::OverloadedVirtual);
add("shadow", WarningFlags::HiddenLocals);
add("sign-compare", WarningFlags::SignedComparison);
add("unknown-pragmas", WarningFlags::UnknownPragma);
add("unused", WarningFlags::UnusedFunctions | WarningFlags::UnusedLocals | WarningFlags::UnusedParams
| WarningFlags::UnusedResult | WarningFlags::UnusedValue);
add("unused-function", WarningFlags::UnusedFunctions);
add("unused-variable", WarningFlags::UnusedLocals);
add("unused-parameter", WarningFlags::UnusedParams);
add("unused-result", WarningFlags::UnusedResult);
add("unused-value", WarningFlags::UnusedValue);
add("uninitialized", WarningFlags::UninitializedVars);
}
return flags;
}
......@@ -1052,14 +1051,14 @@ ToolChain::CompilerFlags ClangToolChain::compilerFlags(const QStringList &cxxfla
return flags;
}
ToolChain::WarningFlags ClangToolChain::warningFlags(const QStringList &cflags) const
WarningFlags ClangToolChain::warningFlags(const QStringList &cflags) const
{
WarningFlags flags = GccToolChain::warningFlags(cflags);
foreach (const QString &flag, cflags) {
if (flag == QLatin1String("-Wdocumentation"))
flags |= WarnDocumentation;
flags |= WarningFlags::Documentation;
if (flag == QLatin1String("-Wno-documentation"))
flags &= ~WarnDocumentation;
flags &= ~WarningFlags::Documentation;
}
return flags;
}
......@@ -1287,7 +1286,7 @@ GccToolChain *LinuxIccToolChainFactory::createToolChain(bool autoDetect)
return new LinuxIccToolChain(autoDetect ? ToolChain::AutoDetection : ToolChain::ManualDetection);
}
GccToolChain::WarningFlagAdder::WarningFlagAdder(const QString &flag, ToolChain::WarningFlags &flags) :
GccToolChain::WarningFlagAdder::WarningFlagAdder(const QString &flag, WarningFlags &flags) :
m_flags(flags),
m_triggered(false)
{
......@@ -1303,7 +1302,7 @@ GccToolChain::WarningFlagAdder::WarningFlagAdder(const QString &flag, ToolChain:
m_flagUtf8 = flag.mid(5).toUtf8();
}
void GccToolChain::WarningFlagAdder::operator ()(const char name[], ToolChain::WarningFlags flagsSet)
void GccToolChain::WarningFlagAdder::operator ()(const char name[], WarningFlags flagsSet)
{
if (m_triggered)
return;
......@@ -1317,11 +1316,6 @@ void GccToolChain::WarningFlagAdder::operator ()(const char name[], ToolChain::W
}
}
void GccToolChain::WarningFlagAdder::operator ()(const char name[], ToolChain::WarningFlag flag)
{
(*this)(name, WarningFlags(flag));
}
bool GccToolChain::WarningFlagAdder::triggered() const
{
return m_triggered;
......
......@@ -125,7 +125,6 @@ protected:
public:
WarningFlagAdder(const QString &flag, WarningFlags &flags);
void operator ()(const char name[], WarningFlags flagsSet);
void operator ()(const char name[], WarningFlag flag);
bool triggered() const;
};
......
......@@ -73,7 +73,6 @@
#include "session.h"
#include "projectnodes.h"
#include "sessiondialog.h"
#include "projectexplorersettingspage.h"
#include "buildconfiguration.h"
#include "miniprojecttargetselector.h"
#include "taskhub.h"
......@@ -631,7 +630,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
addAutoReleasedObject(new ProjectFileWizardExtension);
// Settings pages
addAutoReleasedObject(new ProjectExplorerSettingsPage);
//addAutoReleasedObject(new ProjectExplorerSettingsPage);
addAutoReleasedObject(new DeviceSettingsPage);
// context menus
......
......@@ -154,7 +154,8 @@ HEADERS += projectexplorer.h \
projecttree.h \
expanddata.h \
waitforstopdialog.h \
projectexplorericons.h
projectexplorericons.h \
projectexplorer_global.h
SOURCES += projectexplorer.cpp \
abi.cpp \
......
......@@ -109,6 +109,7 @@ QtcPlugin {
"projectexplorer.cpp", "projectexplorer.h",
"projectexplorer.qrc",
"projectexplorer_export.h",
"projectexplorer_global.h",
"projectexplorerconstants.h",
"projectexplorericons.h",
"projectexplorersettings.h",
......
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#ifndef PROJECTEXPLORER_GLOBAL_H
#define PROJECTEXPLORER_GLOBAL_H
namespace ProjectExplorer {
enum class WarningFlags {
// General settings
NoWarnings = 0,
AsErrors = 1 << 0,
Default = 1 << 1,
All = 1 << 2,
Extra = 1 << 3,
Pedantic = 1 << 4,
// Any language
UnusedLocals = 1 << 7,
UnusedParams = 1 << 8,
UnusedFunctions = 1 << 9,
UnusedResult = 1 << 10,
UnusedValue = 1 << 11,
Documentation = 1 << 12,
UninitializedVars = 1 << 13,
HiddenLocals = 1 << 14,
UnknownPragma = 1 << 15,
Deprecated = 1 << 16,
SignedComparison = 1 << 17,
IgnoredQualfiers = 1 << 18,
// C++
OverloadedVirtual = 1 << 24,
EffectiveCxx = 1 << 25,
NonVirtualDestructor = 1 << 26
};
inline WarningFlags operator|(WarningFlags first, WarningFlags second)
{
return static_cast<WarningFlags>(static_cast<int>(first) | static_cast<int>(second));
}
inline WarningFlags operator&(WarningFlags first, WarningFlags second)
{
return static_cast<WarningFlags>(static_cast<int>(first) & static_cast<int>(second));
}
inline void operator|=(WarningFlags &first, WarningFlags second)
{
first = first | second;
}
inline void operator&=(WarningFlags &first, WarningFlags second)
{
first = first & second;
}
inline WarningFlags operator~(WarningFlags flags)
{
return static_cast<WarningFlags>(~static_cast<int>(flags));
}
} // namespace ProjectExplorer
#endif // PROJECTEXPLORER_GLOBAL_H
......@@ -26,9 +26,10 @@
#ifndef PROJECTEXPLORERSETTINGSPAGE_H
#define PROJECTEXPLORERSETTINGSPAGE_H
#include <coreplugin/dialogs/ioptionspage.h>
#include "ui_projectexplorersettingspage.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <QPointer>
#include <QUuid>
......
......@@ -27,6 +27,8 @@
#define TOOLCHAIN_H
#include "projectexplorer_export.h"
#include "projectexplorer_global.h"
#include <coreplugin/id.h>
#include <utils/fileutils.h>
......@@ -102,35 +104,6 @@ public:
virtual CompilerFlags compilerFlags(const QStringList &cxxflags) const = 0;
enum WarningFlag {
// General settings
WarningsAsErrors,
WarningsDefault,
WarningsAll,
WarningsExtra,
WarningsPedantic,
// Any language
WarnUnusedLocals,
WarnUnusedParams,
WarnUnusedFunctions,
WarnUnusedResult,
WarnUnusedValue,
WarnDocumentation,
WarnUninitializedVars,
WarnHiddenLocals,
WarnUnknownPragma,
WarnDeprecated,
WarnSignedComparison,
WarnIgnoredQualfiers,
// C++
WarnOverloadedVirtual,
WarnEffectiveCxx,
WarnNonVirtualDestructor
};
Q_DECLARE_FLAGS(WarningFlags, WarningFlag)
virtual WarningFlags warningFlags(const QStringList &cflags) const = 0;
virtual QList<HeaderPath> systemHeaderPaths(const QStringList &cxxflags,
const Utils::FileName &sysRoot) const = 0;
......
......@@ -440,7 +440,7 @@ public:
bool isValid() const override { return m_valid; }
QByteArray predefinedMacros(const QStringList &cxxflags) const override { Q_UNUSED(cxxflags); return QByteArray(); }
CompilerFlags compilerFlags(const QStringList &cxxflags) const override { Q_UNUSED(cxxflags); return NoFlags; }
WarningFlags warningFlags(const QStringList &cflags) const override { Q_UNUSED(cflags); return 0; }