/src/CMake/Source/cmGlobalCommonGenerator.h
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | #pragma once |
4 | | |
5 | | #include "cmConfigure.h" // IWYU pragma: keep |
6 | | |
7 | | #include <map> |
8 | | #include <set> |
9 | | #include <string> |
10 | | #include <vector> |
11 | | |
12 | | #include "cmGlobalGenerator.h" |
13 | | |
14 | | class cmake; |
15 | | class cmGeneratorTarget; |
16 | | class cmLocalGenerator; |
17 | | |
18 | | /** \class cmGlobalCommonGenerator |
19 | | * \brief Common infrastructure for Makefile and Ninja global generators. |
20 | | */ |
21 | | class cmGlobalCommonGenerator : public cmGlobalGenerator |
22 | | { |
23 | | public: |
24 | | cmGlobalCommonGenerator(cmake* cm); |
25 | | ~cmGlobalCommonGenerator() override; |
26 | | |
27 | | struct DirectoryTarget |
28 | | { |
29 | | cmLocalGenerator* LG = nullptr; |
30 | | struct Target |
31 | | { |
32 | | cmGeneratorTarget const* GT = nullptr; |
33 | | std::vector<std::string> ExcludedFromAllInConfigs; |
34 | | }; |
35 | | std::vector<Target> Targets; |
36 | | struct Dir |
37 | | { |
38 | | std::string Path; |
39 | | bool ExcludeFromAll = false; |
40 | | }; |
41 | | std::vector<Dir> Children; |
42 | | }; |
43 | | std::map<std::string, DirectoryTarget> ComputeDirectoryTargets() const; |
44 | | bool IsExcludedFromAllInConfig(DirectoryTarget::Target const& t, |
45 | | std::string const& config); |
46 | | void AddClangTidyExportFixesDir(std::string const& dir) |
47 | 0 | { |
48 | 0 | this->ClangTidyExportFixesDirs.insert(dir); |
49 | 0 | } |
50 | | void AddClangTidyExportFixesFile(std::string const& file) |
51 | 0 | { |
52 | 0 | this->ClangTidyExportFixesFiles.insert(file); |
53 | 0 | } |
54 | | |
55 | | protected: |
56 | 0 | virtual bool SupportsDirectConsole() const { return true; } |
57 | 0 | char const* GetEditCacheTargetName() const override { return "edit_cache"; } |
58 | | std::string GetEditCacheCommand() const override; |
59 | | |
60 | | std::set<std::string> ClangTidyExportFixesDirs; |
61 | | std::set<std::string> ClangTidyExportFixesFiles; |
62 | | void RemoveUnknownClangTidyExportFixesFiles() const; |
63 | | }; |