cmCustomCommand.cxx 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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 "cmCustomCommand.h"
  4. #include <utility>
  5. #include <cmext/algorithm>
  6. cmCustomCommand::cmCustomCommand(std::vector<std::string> outputs,
  7. std::vector<std::string> byproducts,
  8. std::vector<std::string> depends,
  9. cmCustomCommandLines commandLines,
  10. cmListFileBacktrace lfbt, const char* comment,
  11. const char* workingDirectory,
  12. bool stdPipesUTF8)
  13. : Outputs(std::move(outputs))
  14. , Byproducts(std::move(byproducts))
  15. , Depends(std::move(depends))
  16. , CommandLines(std::move(commandLines))
  17. , Backtrace(std::move(lfbt))
  18. , Comment(comment ? comment : "")
  19. , WorkingDirectory(workingDirectory ? workingDirectory : "")
  20. , HaveComment(comment != nullptr)
  21. , StdPipesUTF8(stdPipesUTF8)
  22. {
  23. }
  24. const std::vector<std::string>& cmCustomCommand::GetOutputs() const
  25. {
  26. return this->Outputs;
  27. }
  28. const std::vector<std::string>& cmCustomCommand::GetByproducts() const
  29. {
  30. return this->Byproducts;
  31. }
  32. const std::vector<std::string>& cmCustomCommand::GetDepends() const
  33. {
  34. return this->Depends;
  35. }
  36. const cmCustomCommandLines& cmCustomCommand::GetCommandLines() const
  37. {
  38. return this->CommandLines;
  39. }
  40. const char* cmCustomCommand::GetComment() const
  41. {
  42. const char* no_comment = nullptr;
  43. return this->HaveComment ? this->Comment.c_str() : no_comment;
  44. }
  45. void cmCustomCommand::AppendCommands(const cmCustomCommandLines& commandLines)
  46. {
  47. cm::append(this->CommandLines, commandLines);
  48. }
  49. void cmCustomCommand::AppendDepends(const std::vector<std::string>& depends)
  50. {
  51. cm::append(this->Depends, depends);
  52. }
  53. bool cmCustomCommand::GetEscapeOldStyle() const
  54. {
  55. return this->EscapeOldStyle;
  56. }
  57. void cmCustomCommand::SetEscapeOldStyle(bool b)
  58. {
  59. this->EscapeOldStyle = b;
  60. }
  61. bool cmCustomCommand::GetEscapeAllowMakeVars() const
  62. {
  63. return this->EscapeAllowMakeVars;
  64. }
  65. void cmCustomCommand::SetEscapeAllowMakeVars(bool b)
  66. {
  67. this->EscapeAllowMakeVars = b;
  68. }
  69. cmListFileBacktrace const& cmCustomCommand::GetBacktrace() const
  70. {
  71. return this->Backtrace;
  72. }
  73. cmImplicitDependsList const& cmCustomCommand::GetImplicitDepends() const
  74. {
  75. return this->ImplicitDepends;
  76. }
  77. void cmCustomCommand::SetImplicitDepends(cmImplicitDependsList const& l)
  78. {
  79. this->ImplicitDepends = l;
  80. }
  81. void cmCustomCommand::AppendImplicitDepends(cmImplicitDependsList const& l)
  82. {
  83. cm::append(this->ImplicitDepends, l);
  84. }
  85. bool cmCustomCommand::GetUsesTerminal() const
  86. {
  87. return this->UsesTerminal;
  88. }
  89. void cmCustomCommand::SetUsesTerminal(bool b)
  90. {
  91. this->UsesTerminal = b;
  92. }
  93. bool cmCustomCommand::GetCommandExpandLists() const
  94. {
  95. return this->CommandExpandLists;
  96. }
  97. void cmCustomCommand::SetCommandExpandLists(bool b)
  98. {
  99. this->CommandExpandLists = b;
  100. }
  101. const std::string& cmCustomCommand::GetDepfile() const
  102. {
  103. return this->Depfile;
  104. }
  105. void cmCustomCommand::SetDepfile(const std::string& depfile)
  106. {
  107. this->Depfile = depfile;
  108. }
  109. const std::string& cmCustomCommand::GetJobPool() const
  110. {
  111. return this->JobPool;
  112. }
  113. void cmCustomCommand::SetJobPool(const std::string& job_pool)
  114. {
  115. this->JobPool = job_pool;
  116. }
  117. cmPolicies::PolicyStatus cmCustomCommand::GetCMP0116Status() const
  118. {
  119. return this->CMP0116Status;
  120. }
  121. void cmCustomCommand::SetCMP0116Status(cmPolicies::PolicyStatus cmp0116)
  122. {
  123. this->CMP0116Status = cmp0116;
  124. }