cmStandardLevelResolver.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmStandardLevelResolver_h
  4. #define cmStandardLevelResolver_h
  5. #include <string>
  6. #include "cmProperty.h"
  7. class cmMakefile;
  8. class cmGeneratorTarget;
  9. class cmTarget;
  10. class cmStandardLevelResolver
  11. {
  12. public:
  13. explicit cmStandardLevelResolver(cmMakefile* makefile)
  14. : Makefile(makefile)
  15. {
  16. }
  17. bool AddRequiredTargetFeature(cmTarget* target, const std::string& feature,
  18. std::string* error = nullptr) const;
  19. bool CompileFeatureKnown(const std::string& targetName,
  20. const std::string& feature, std::string& lang,
  21. std::string* error) const;
  22. const char* CompileFeaturesAvailable(const std::string& lang,
  23. std::string* error) const;
  24. bool GetNewRequiredStandard(const std::string& targetName,
  25. const std::string& feature,
  26. cmProp currentLangStandardValue,
  27. std::string& newRequiredStandard,
  28. std::string* error = nullptr) const;
  29. bool HaveStandardAvailable(cmGeneratorTarget const* target,
  30. std::string const& lang,
  31. std::string const& config,
  32. const std::string& feature) const;
  33. bool IsLaterStandard(std::string const& lang, std::string const& lhs,
  34. std::string const& rhs) const;
  35. private:
  36. bool CheckCompileFeaturesAvailable(const std::string& targetName,
  37. const std::string& feature,
  38. std::string& lang,
  39. std::string* error) const;
  40. cmMakefile* Makefile;
  41. };
  42. #endif