resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmEnableLanguageCommand.cxx
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
5 #include "cmExecutionStatus.h"
6 #include "cmMakefile.h"
7
8 bool cmEnableLanguageCommand(std::vector<std::string> const& args,
9                              cmExecutionStatus& status)
10 {
11   if (args.empty()) {
12     status.SetError("called with incorrect number of arguments");
13     return false;
14   }
15
16   bool optional = false;
17   std::vector<std::string> languages;
18   for (std::string const& it : args) {
19     if (it == "OPTIONAL") {
20       optional = true;
21     } else {
22       languages.push_back(it);
23     }
24   }
25
26   status.GetMakefile().EnableLanguage(languages, optional);
27   return true;
28 }