cmEnableLanguageCommand.cxx 811 B

1234567891011121314151617181920212223242526
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmEnableLanguageCommand.h"
  4. // cmEnableLanguageCommand
  5. bool cmEnableLanguageCommand::InitialPass(std::vector<std::string> const& args,
  6. cmExecutionStatus&)
  7. {
  8. bool optional = false;
  9. std::vector<std::string> languages;
  10. if (args.empty()) {
  11. this->SetError("called with incorrect number of arguments");
  12. return false;
  13. }
  14. for (std::vector<std::string>::const_iterator it = args.begin();
  15. it != args.end(); ++it) {
  16. if ((*it) == "OPTIONAL") {
  17. optional = true;
  18. } else {
  19. languages.push_back(*it);
  20. }
  21. }
  22. this->Makefile->EnableLanguage(languages, optional);
  23. return true;
  24. }