cmGlobalCommonGenerator.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <map>
  6. #include <string>
  7. #include <vector>
  8. #include "cmGlobalGenerator.h"
  9. class cmake;
  10. class cmGeneratorTarget;
  11. class cmLocalGenerator;
  12. /** \class cmGlobalCommonGenerator
  13. * \brief Common infrastructure for Makefile and Ninja global generators.
  14. */
  15. class cmGlobalCommonGenerator : public cmGlobalGenerator
  16. {
  17. public:
  18. cmGlobalCommonGenerator(cmake* cm);
  19. ~cmGlobalCommonGenerator() override;
  20. struct DirectoryTarget
  21. {
  22. cmLocalGenerator* LG = nullptr;
  23. struct Target
  24. {
  25. cmGeneratorTarget const* GT = nullptr;
  26. std::vector<std::string> ExcludedFromAllInConfigs;
  27. };
  28. std::vector<Target> Targets;
  29. struct Dir
  30. {
  31. std::string Path;
  32. bool ExcludeFromAll = false;
  33. };
  34. std::vector<Dir> Children;
  35. };
  36. std::map<std::string, DirectoryTarget> ComputeDirectoryTargets() const;
  37. bool IsExcludedFromAllInConfig(const DirectoryTarget::Target& t,
  38. const std::string& config);
  39. protected:
  40. virtual bool SupportsDirectConsole() const { return true; }
  41. const char* GetEditCacheTargetName() const override { return "edit_cache"; }
  42. };