resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmGlobalCommonGenerator.h
1 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2    file Copyright.txt or https://cmake.org/licensing for details.  */
3 #pragma once
4
5 #include "cmConfigure.h" // IWYU pragma: keep
6
7 #include <map>
8 #include <string>
9 #include <vector>
10
11 #include "cmGlobalGenerator.h"
12
13 class cmake;
14 class cmGeneratorTarget;
15 class cmLocalGenerator;
16
17 /** \class cmGlobalCommonGenerator
18  * \brief Common infrastructure for Makefile and Ninja global generators.
19  */
20 class cmGlobalCommonGenerator : public cmGlobalGenerator
21 {
22 public:
23   cmGlobalCommonGenerator(cmake* cm);
24   ~cmGlobalCommonGenerator() override;
25
26   struct DirectoryTarget
27   {
28     cmLocalGenerator* LG = nullptr;
29     struct Target
30     {
31       cmGeneratorTarget const* GT = nullptr;
32       std::vector<std::string> ExcludedFromAllInConfigs;
33     };
34     std::vector<Target> Targets;
35     struct Dir
36     {
37       std::string Path;
38       bool ExcludeFromAll = false;
39     };
40     std::vector<Dir> Children;
41   };
42   std::map<std::string, DirectoryTarget> ComputeDirectoryTargets() const;
43   bool IsExcludedFromAllInConfig(const DirectoryTarget::Target& t,
44                                  const std::string& config);
45
46 protected:
47   virtual bool SupportsDirectConsole() const { return true; }
48   const char* GetEditCacheTargetName() const override { return "edit_cache"; }
49   std::string GetEditCacheCommand() const override;
50 };