diff --git a/src/plugins/compilationdatabaseprojectmanager/CompilationDatabaseProjectManager.json.in b/src/plugins/compilationdatabaseprojectmanager/CompilationDatabaseProjectManager.json.in new file mode 100644 index 00000000000..00da891d743 --- /dev/null +++ b/src/plugins/compilationdatabaseprojectmanager/CompilationDatabaseProjectManager.json.in @@ -0,0 +1,30 @@ +{ + \"Name\" : \"CompilationDatabaseProjectManager\", + \"Version\" : \"$$QTCREATOR_VERSION\", + \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", + \"Experimental\" : true, + \"Vendor\" : \"The Qt Company Ltd\", + \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", + \"License\" : [ \"Commercial Usage\", + \"\", + \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt 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.\", + \"\", + \"GNU General Public License Usage\", + \"\", + \"Alternatively, this plugin 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 plugin. 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.\" + ], + \"Category\" : \"Build Systems\", + \"Description\" : \"Compilation Database project support.\", + \"Url\" : \"http://www.qt.io\", + $$dependencyList, + \"Mimetypes\" : [ + \"\", + \"\", + \" \", + \" \", + \" Compilation Database file\", + \" \", + \" \", + \"\" + ] +} diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseconstants.h b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseconstants.h new file mode 100644 index 00000000000..1cb47d5dfd2 --- /dev/null +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseconstants.h @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 2018 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. +** +****************************************************************************/ + +#pragma once + +namespace CompilationDatabaseProjectManager { +namespace Constants { + +const char COMPILATIONDATABASEMIMETYPE[] = "text/x-compilation-database-project"; +const char COMPILATIONDATABASEPROJECT_ID[] = "CompilationDatabase.CompilationDatabaseEditor"; + +} // Constants +} // CompilationDatabaseProjectManager diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp new file mode 100644 index 00000000000..487652aeb94 --- /dev/null +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp @@ -0,0 +1,295 @@ +/**************************************************************************** +** +** Copyright (C) 2018 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. +** +****************************************************************************/ + +#include "compilationdatabaseproject.h" + +#include "compilationdatabaseconstants.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +namespace CompilationDatabaseProjectManager { +namespace Internal { + +class DBProjectNode : public ProjectExplorer::ProjectNode +{ +public: + explicit DBProjectNode(const Utils::FileName &projectFilePath) + : ProjectExplorer::ProjectNode(projectFilePath) + {} +}; + +static QStringList splitCommandLine(const QString &line) +{ + QStringList result; + bool insideQuotes = false; + + for (const QString &part : line.split(QRegularExpression("\""))) { + if (insideQuotes) { + const QString quotedPart = "\"" + part + "\""; + if (result.last().endsWith("=")) + result.last().append(quotedPart); + else + result.append(quotedPart); + } else { // If 's' is outside quotes ... + result.append(part.split(QRegularExpression("\\s+"), QString::SkipEmptyParts)); + } + insideQuotes = !insideQuotes; + } + return result; +} + +static QString updatedPathFlag(const QString &pathStr, const QString &workingDir, + const QString &originalFlag) +{ + QString result = pathStr; + if (!QDir(pathStr).exists() + && QDir(workingDir + "/" + pathStr).exists()) { + result = workingDir + "/" + pathStr; + } + + if (originalFlag.startsWith("-I")) + return "-I" + result; + + if (originalFlag.startsWith("-isystem")) + return "-isystem" + result; + + return result; +} + +static QStringList filteredFlags(const QStringList &flags, const QString &fileName, + const QString &workingDir) +{ + QStringList filtered; + // Skip compiler call if present. + bool skipNext = !flags.first().startsWith('-'); + bool includePath = false; + + for (const QString &flag : flags) { + if (skipNext) { + skipNext = false; + continue; + } + + QString pathStr; + if (includePath) { + includePath = false; + pathStr = flag; + } else if ((flag.startsWith("-I") || flag.startsWith("-isystem")) + && flag != "-I" && flag != "-isystem") { + pathStr = flag.mid(flag.startsWith("-I") ? 2 : 8); + } + + if (!pathStr.isEmpty()) { + filtered.push_back(updatedPathFlag(pathStr, workingDir, flag)); + continue; + } + + if (flag == "-c" || flag == "-pedantic" || flag.startsWith("/") || flag.startsWith("-m") + || flag.startsWith("-O") || flag.startsWith("-W") || flag.startsWith("-w") + || flag.startsWith("--sysroot=")) { + continue; + } + + if (flag == "-target" || flag == "-triple" || flag == "-isysroot" || flag == "-isystem" + || flag == "--sysroot") { + skipNext = true; + continue; + } + + if (flag.endsWith(fileName)) + continue; + + if (flag == "-I" || flag == "-isystem") + includePath = true; + + filtered.push_back(flag); + } + + return filtered; +} + +static CppTools::RawProjectPart makeRawProjectPart(const Utils::FileName &projectFile, + const QJsonObject &object) +{ + const Utils::FileName fileName = Utils::FileName::fromString( + QDir::fromNativeSeparators(object["file"].toString())); + QStringList flags; + const QJsonArray arguments = object["arguments"].toArray(); + if (arguments.isEmpty()) { + flags = splitCommandLine(object["command"].toString()); + } else { + for (const QJsonValue &arg : arguments) + flags.append(arg.toString()); + } + + const QString workingDir = object["directory"].toString(); + flags = filteredFlags(flags, fileName.fileName(), workingDir); + + CppTools::RawProjectPart rpp; + rpp.setProjectFileLocation(projectFile.toString()); + rpp.setBuildSystemTarget(workingDir); + rpp.setDisplayName(fileName.fileName()); + rpp.setFiles({fileName.toString()}); + + CppTools::RawProjectPartFlags cxxProjectFlags; + cxxProjectFlags.commandLineFlags = flags; + rpp.setFlagsForCxx(cxxProjectFlags); + + return rpp; +} + +CompilationDatabaseProject::CompilationDatabaseProject(const Utils::FileName &projectFile) + : Project(Constants::COMPILATIONDATABASEMIMETYPE, projectFile) + , m_cppCodeModelUpdater(std::make_unique(this)) +{ + setId(Constants::COMPILATIONDATABASEPROJECT_ID); + setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID)); + setDisplayName(projectDirectory().fileName()); + + connect(this, &Project::activeTargetChanged, [this, projectFile](ProjectExplorer::Target *target) { + if (!target) + return; + + ProjectExplorer::Kit *kit = target->kit(); + if (!kit) + return; + + auto toolchains = ProjectExplorer::ToolChainKitInformation::toolChains(kit); + if (toolchains.isEmpty()) + return; + + emitParsingStarted(); + + const QFuture future = ::Utils::runAsync([this, projectFile, kit, + tc = toolchains.first()](){ + QFile file(projectFilePath().toString()); + if (!file.open(QIODevice::ReadOnly)) { + emitParsingFinished(false); + return; + } + + const QJsonArray array = QJsonDocument::fromJson(file.readAll()).array(); + + auto root = std::make_unique(projectDirectory()); + root->addNode(std::make_unique( + projectFile, + ProjectExplorer::FileType::Project, + false)); + auto headers = std::make_unique( + Utils::FileName::fromString("Headers"), 0); + auto sources = std::make_unique( + Utils::FileName::fromString("Sources"), 0); + CppTools::RawProjectParts rpps; + for (const QJsonValue &element : array) { + const QJsonObject object = element.toObject(); + const QString filePath = object["file"].toString(); + const CppTools::ProjectFile::Kind kind = CppTools::ProjectFile::classify(filePath); + ProjectExplorer::FolderNode *parent = nullptr; + ProjectExplorer::FileType type = ProjectExplorer::FileType::Unknown; + if (CppTools::ProjectFile::isHeader(kind)) { + parent = headers.get(); + type = ProjectExplorer::FileType::Header; + } else if (CppTools::ProjectFile::isSource(kind)) { + parent = sources.get(); + type = ProjectExplorer::FileType::Source; + } else { + parent = root.get(); + } + parent->addNode(std::make_unique( + Utils::FileName::fromString(filePath), type, false)); + + rpps.append(makeRawProjectPart(projectFile, object)); + } + + root->addNode(std::move(headers)); + root->addNode(std::move(sources)); + + setRootProjectNode(std::move(root)); + + CppTools::ToolChainInfo tcInfo; + tcInfo.type = ProjectExplorer::Constants::COMPILATION_DATABASE_TOOLCHAIN_TYPEID; + tcInfo.isMsvc2015ToolChain + = tc->targetAbi().osFlavor() == ProjectExplorer::Abi::WindowsMsvc2015Flavor; + tcInfo.wordWidth = tc->targetAbi().wordWidth(); + tcInfo.targetTriple = tc->originalTargetTriple(); + tcInfo.sysRootPath = ProjectExplorer::SysRootKitInformation::sysRoot(kit).toString(); + tcInfo.headerPathsRunner = tc->createBuiltInHeaderPathsRunner(); + tcInfo.predefinedMacrosRunner = tc->createPredefinedMacrosRunner(); + + m_cppCodeModelUpdater->update({this, tcInfo, tcInfo, rpps}); + + emitParsingFinished(true); + }); + m_parserWatcher.setFuture(future); + }); +} + +CompilationDatabaseProject::~CompilationDatabaseProject() +{ + m_parserWatcher.cancel(); + m_parserWatcher.waitForFinished(); +} + +static TextEditor::TextDocument *createCompilationDatabaseDocument() +{ + auto doc = new TextEditor::TextDocument; + doc->setId(Constants::COMPILATIONDATABASEPROJECT_ID); + doc->setMimeType(Constants::COMPILATIONDATABASEMIMETYPE); + return doc; +} + +CompilationDatabaseEditorFactory::CompilationDatabaseEditorFactory() +{ + setId(Constants::COMPILATIONDATABASEPROJECT_ID); + setDisplayName("Compilation Database"); + addMimeType(Constants::COMPILATIONDATABASEMIMETYPE); + + setEditorCreator([]() { return new TextEditor::BaseTextEditor; }); + setEditorWidgetCreator([]() { return new TextEditor::TextEditorWidget; }); + setDocumentCreator(createCompilationDatabaseDocument); + setUseGenericHighlighter(true); + setCommentDefinition(Utils::CommentDefinition::HashStyle); + setCodeFoldingSupported(true); +} + +} // namespace Internal +} // namespace CompilationDatabaseProjectManager diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.h b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.h new file mode 100644 index 00000000000..2ba01adbaac --- /dev/null +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2018 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. +** +****************************************************************************/ + +#pragma once + +#include + +#include + +#include + +namespace CppTools { +class CppProjectUpdater; +} + +namespace CompilationDatabaseProjectManager { +namespace Internal { + +class CompilationDatabaseProject : public ProjectExplorer::Project +{ + Q_OBJECT + +public: + explicit CompilationDatabaseProject(const Utils::FileName &filename); + ~CompilationDatabaseProject() override; + +private: + QFutureWatcher m_parserWatcher; + std::unique_ptr m_cppCodeModelUpdater; +}; + +class CompilationDatabaseEditorFactory : public TextEditor::TextEditorFactory +{ + Q_OBJECT + +public: + CompilationDatabaseEditorFactory(); +}; + +} // namespace Internal +} // namespace CompilationDatabaseProjectManager diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseprojectmanager.pro b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseprojectmanager.pro new file mode 100644 index 00000000000..a815c0db8eb --- /dev/null +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseprojectmanager.pro @@ -0,0 +1,10 @@ +include(../../qtcreatorplugin.pri) + +SOURCES = \ + compilationdatabaseproject.cpp \ + compilationdatabaseprojectmanagerplugin.cpp + +HEADERS = \ + compilationdatabaseproject.h \ + compilationdatabaseprojectmanagerplugin.h \ + compilationdatabaseconstants.h diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseprojectmanager_dependencies.pri b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseprojectmanager_dependencies.pri new file mode 100644 index 00000000000..a41891ad4c1 --- /dev/null +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseprojectmanager_dependencies.pri @@ -0,0 +1,11 @@ +QTC_PLUGIN_NAME = CompilationDatabaseProjectManager + +QTC_LIB_DEPENDS += \ + extensionsystem \ + qmljs +QTC_PLUGIN_DEPENDS += \ + clangcodemodel \ + coreplugin \ + cpptools \ + projectexplorer \ + qtsupport diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseprojectmanagerplugin.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseprojectmanagerplugin.cpp new file mode 100644 index 00000000000..1fe0d6d032e --- /dev/null +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseprojectmanagerplugin.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2018 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. +** +****************************************************************************/ + +#include "compilationdatabaseprojectmanagerplugin.h" + +#include "compilationdatabaseconstants.h" +#include "compilationdatabaseproject.h" + +#include +#include +#include + +namespace CompilationDatabaseProjectManager { +namespace Internal { + +bool CompilationDatabaseProjectManagerPlugin::initialize(const QStringList &arguments, QString *errorMessage) +{ + Q_UNUSED(arguments); + Q_UNUSED(errorMessage); + Core::FileIconProvider::registerIconOverlayForFilename(Utils::Icons::PROJECT.imageFileName(), + "compile_commands.json"); + + ProjectExplorer::ProjectManager::registerProjectType( + Constants::COMPILATIONDATABASEMIMETYPE); + + return true; +} + +void CompilationDatabaseProjectManagerPlugin::extensionsInitialized() +{ +} + +} // namespace Internal +} // namespace CompilationDatabaseProjectManager diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseprojectmanagerplugin.h b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseprojectmanagerplugin.h new file mode 100644 index 00000000000..a89db25e37b --- /dev/null +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseprojectmanagerplugin.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2018 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. +** +****************************************************************************/ + +#pragma once + +#include "compilationdatabaseproject.h" + +#include +#include +#include + +namespace CompilationDatabaseProjectManager { +namespace Internal { + +class CompilationDatabaseProjectManagerPlugin final : public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CompilationDatabaseProjectManager.json") + +public: + bool initialize(const QStringList &arguments, QString *errorMessage) final; + void extensionsInitialized() final; +private: + CompilationDatabaseEditorFactory factory; +}; + +} // namespace Internal +} // namespace CompilationDatabaseProjectManager diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index a758e7de31c..812de0fb598 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -68,6 +68,14 @@ QStringList CompilerOptionsBuilder::build(CppTools::ProjectFile::Kind fileKind, addWordWidth(); addTargetTriple(); addExtraCodeModelFlags(); + + if (m_projectPart.toolchainType + == ProjectExplorer::Constants::COMPILATION_DATABASE_TOOLCHAIN_TYPEID) { + addHeaderPathOptions(); + insertWrappedQtHeaders(); + return options(); + } + updateLanguageOption(fileKind); addOptionsForLanguage(/*checkForBorlandExtensions*/ true); enableExceptions(); diff --git a/src/plugins/cpptools/cppprojectinfogenerator.cpp b/src/plugins/cpptools/cppprojectinfogenerator.cpp index 133a5237d22..fd1c9280902 100644 --- a/src/plugins/cpptools/cppprojectinfogenerator.cpp +++ b/src/plugins/cpptools/cppprojectinfogenerator.cpp @@ -28,6 +28,7 @@ #include "cppprojectfilecategorizer.h" #include +#include namespace CppTools { namespace Internal { @@ -56,6 +57,10 @@ public: m_projectPart.warningFlags = m_flags.warningFlags; + // For compilation database pass the command line flags directly. + if (m_projectPart.toolchainType == ProjectExplorer::Constants::COMPILATION_DATABASE_TOOLCHAIN_TYPEID) + m_projectPart.extraCodeModelFlags = m_flags.commandLineFlags; + mapLanguageVersion(); mapLanguageExtensions(); diff --git a/src/plugins/cpptools/projectinfo.cpp b/src/plugins/cpptools/projectinfo.cpp index adcabc90954..a51caebe111 100644 --- a/src/plugins/cpptools/projectinfo.cpp +++ b/src/plugins/cpptools/projectinfo.cpp @@ -66,6 +66,19 @@ ProjectUpdateInfo::ProjectUpdateInfo(ProjectExplorer::Project *project, { } +ProjectUpdateInfo::ProjectUpdateInfo(ProjectExplorer::Project *project, + const ToolChainInfo &cToolChainInfo, + const ToolChainInfo &cxxToolChainInfo, + const RawProjectParts &rawProjectParts) + : project(project) + , rawProjectParts(rawProjectParts) + , cToolChain(nullptr) + , cxxToolChain(nullptr) + , cToolChainInfo(cToolChainInfo) + , cxxToolChainInfo(cxxToolChainInfo) +{ +} + ProjectInfo::ProjectInfo(QPointer project) : m_project(project) { diff --git a/src/plugins/cpptools/projectinfo.h b/src/plugins/cpptools/projectinfo.h index 8b30998744b..38bf509cba2 100644 --- a/src/plugins/cpptools/projectinfo.h +++ b/src/plugins/cpptools/projectinfo.h @@ -70,6 +70,10 @@ public: const ProjectExplorer::ToolChain *cxxToolChain, const ProjectExplorer::Kit *kit, const RawProjectParts &rawProjectParts); + ProjectUpdateInfo(ProjectExplorer::Project *project, + const ToolChainInfo &cToolChainInfo, + const ToolChainInfo &cxxToolChainInfo, + const RawProjectParts &rawProjectParts); bool isValid() const { return project && !rawProjectParts.isEmpty(); } public: diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 2829f1f2330..ae9a31f0258 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -58,7 +58,8 @@ SUBDIRS = \ welcome \ silversearcher \ languageclient \ - cppcheck + cppcheck \ + compilationdatabaseprojectmanager qtHaveModule(serialport) { SUBDIRS += serialterminal diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index 61f1429fbe9..5fcb7f95f19 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -163,6 +163,7 @@ const char MINGW_TOOLCHAIN_TYPEID[] = "ProjectExplorer.ToolChain.Mingw"; const char MSVC_TOOLCHAIN_TYPEID[] = "ProjectExplorer.ToolChain.Msvc"; const char CLANG_CL_TOOLCHAIN_TYPEID[] = "ProjectExplorer.ToolChain.ClangCl"; const char CUSTOM_TOOLCHAIN_TYPEID[] = "ProjectExplorer.ToolChain.Custom"; +const char COMPILATION_DATABASE_TOOLCHAIN_TYPEID[] = "ProjectExplorer.ToolChain.Empty"; // Default directory to run custom (build) commands in. const char DEFAULT_WORKING_DIR[] = "%{buildDir}";