cmGenExContext.cxx 768 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file LICENSE.rst or https://cmake.org/licensing for details. */
  3. #include "cmGenExContext.h"
  4. #include <utility>
  5. #include <cm/optional>
  6. #include "cmLocalGenerator.h"
  7. #include "cmPolicies.h"
  8. namespace cm {
  9. namespace GenEx {
  10. Context::Context(cmLocalGenerator const* lg, std::string config,
  11. std::string language)
  12. : LG(lg)
  13. , Config(std::move(config))
  14. , Language(std::move(language))
  15. {
  16. }
  17. void Context::SetCMP0189(cmPolicies::PolicyStatus cmp0189)
  18. {
  19. this->CMP0189 = cmp0189;
  20. }
  21. cmPolicies::PolicyStatus Context::GetCMP0189() const
  22. {
  23. if (this->CMP0189.has_value()) {
  24. return *this->CMP0189;
  25. }
  26. return this->LG->GetPolicyStatus(cmPolicies::CMP0189);
  27. }
  28. }
  29. }