cmake/Source/cmGlobalCommonGenerator.h

64 lines
1.7 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2021-09-14 00:13:48 +02:00
#pragma once
2015-11-17 17:22:37 +01:00
2018-01-26 17:06:56 +01:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
2020-02-01 23:06:01 +01:00
#include <map>
2023-05-23 16:38:00 +02:00
#include <set>
2020-02-01 23:06:01 +01:00
#include <string>
#include <vector>
2015-11-17 17:22:37 +01:00
#include "cmGlobalGenerator.h"
2016-10-30 18:24:19 +01:00
class cmake;
2020-02-01 23:06:01 +01:00
class cmGeneratorTarget;
class cmLocalGenerator;
2016-10-30 18:24:19 +01:00
2015-11-17 17:22:37 +01:00
/** \class cmGlobalCommonGenerator
* \brief Common infrastructure for Makefile and Ninja global generators.
*/
class cmGlobalCommonGenerator : public cmGlobalGenerator
{
public:
cmGlobalCommonGenerator(cmake* cm);
2018-01-26 17:06:56 +01:00
~cmGlobalCommonGenerator() override;
2020-02-01 23:06:01 +01:00
struct DirectoryTarget
{
cmLocalGenerator* LG = nullptr;
struct Target
{
cmGeneratorTarget const* GT = nullptr;
2021-09-14 00:13:48 +02:00
std::vector<std::string> ExcludedFromAllInConfigs;
2020-02-01 23:06:01 +01:00
};
std::vector<Target> Targets;
struct Dir
{
std::string Path;
bool ExcludeFromAll = false;
};
std::vector<Dir> Children;
};
std::map<std::string, DirectoryTarget> ComputeDirectoryTargets() const;
2021-09-14 00:13:48 +02:00
bool IsExcludedFromAllInConfig(const DirectoryTarget::Target& t,
const std::string& config);
2023-05-23 16:38:00 +02:00
void AddClangTidyExportFixesDir(const std::string& dir)
{
this->ClangTidyExportFixesDirs.insert(dir);
}
void AddClangTidyExportFixesFile(const std::string& file)
{
this->ClangTidyExportFixesFiles.insert(file);
}
2021-11-20 13:41:27 +01:00
protected:
virtual bool SupportsDirectConsole() const { return true; }
const char* GetEditCacheTargetName() const override { return "edit_cache"; }
std::string GetEditCacheCommand() const override;
2023-05-23 16:38:00 +02:00
std::set<std::string> ClangTidyExportFixesDirs;
std::set<std::string> ClangTidyExportFixesFiles;
void RemoveUnknownClangTidyExportFixesFiles() const;
2015-11-17 17:22:37 +01:00
};