| 14 | namespace { |
| 15 | |
| 16 | class TargetCompileOptionsImpl : public cmTargetPropCommandBase |
| 17 | { |
| 18 | public: |
| 19 | using cmTargetPropCommandBase::cmTargetPropCommandBase; |
| 20 | |
| 21 | private: |
| 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…