MCPcopy Create free account
hub / github.com/Kitware/CMake / TargetCompileOptionsImpl

Class TargetCompileOptionsImpl

Source/cmTargetCompileOptionsCommand.cxx:16–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace {
15
16class TargetCompileOptionsImpl : public cmTargetPropCommandBase
17{
18public:
19 using cmTargetPropCommandBase::cmTargetPropCommandBase;
20
21private:
22 void HandleMissingTarget(std::string const& name) override
23 {
24 this->Makefile->IssueMessage(
25 MessageType::FATAL_ERROR,
26 cmStrCat("Cannot specify compile options for target \"", name,
27 "\" which is not built by this project."));
28 }
29
30 bool HandleDirectContent(cmTarget* tgt,
31 std::vector<std::string> const& content,
32 bool prepend, bool /*system*/) override
33 {
34 cmPolicies::PolicyStatus policyStatus =
35 this->Makefile->GetPolicyStatus(cmPolicies::CMP0101);
36 if (policyStatus == cmPolicies::OLD || policyStatus == cmPolicies::WARN) {
37 prepend = false;
38 }
39
40 cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
41 tgt->InsertCompileOption(BT<std::string>(this->Join(content), lfbt),
42 prepend);
43 return true; // Successfully handled.
44 }
45
46 std::string Join(std::vector<std::string> const& content) override
47 {
48 return cmList::to_string(content);
49 }
50};
51
52} // namespace
53

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…