cmTargetLinkOptionsCommand.cxx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 "cmTargetLinkOptionsCommand.h"
  4. #include "cmListFileCache.h"
  5. #include "cmMakefile.h"
  6. #include "cmMessageType.h"
  7. #include "cmStringAlgorithms.h"
  8. #include "cmTarget.h"
  9. class cmExecutionStatus;
  10. bool cmTargetLinkOptionsCommand::InitialPass(
  11. std::vector<std::string> const& args, cmExecutionStatus&)
  12. {
  13. return this->HandleArguments(args, "LINK_OPTIONS", PROCESS_BEFORE);
  14. }
  15. void cmTargetLinkOptionsCommand::HandleMissingTarget(const std::string& name)
  16. {
  17. this->Makefile->IssueMessage(
  18. MessageType::FATAL_ERROR,
  19. cmStrCat("Cannot specify link options for target \"", name,
  20. "\" which is not built by this project."));
  21. }
  22. std::string cmTargetLinkOptionsCommand::Join(
  23. const std::vector<std::string>& content)
  24. {
  25. return cmJoin(content, ";");
  26. }
  27. bool cmTargetLinkOptionsCommand::HandleDirectContent(
  28. cmTarget* tgt, const std::vector<std::string>& content, bool prepend, bool)
  29. {
  30. cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
  31. tgt->InsertLinkOption(this->Join(content), lfbt, prepend);
  32. return true; // Successfully handled.
  33. }