| 3549 | int NumExpectedParameters() const override { return ZeroOrMoreParameters; } |
| 3550 | |
| 3551 | std::string Evaluate( |
| 3552 | std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval, |
| 3553 | GeneratorExpressionContent const* content, |
| 3554 | cmGeneratorExpressionDAGChecker* dagChecker) const override |
| 3555 | { |
| 3556 | if (!eval->HeadTarget || !dagChecker || |
| 3557 | !dagChecker->EvaluatingLinkOptionsExpression()) { |
| 3558 | reportError(eval, content->GetOriginalExpression(), |
| 3559 | "$<DEVICE_LINK:...> may only be used with binary targets " |
| 3560 | "to specify link options."); |
| 3561 | return std::string(); |
| 3562 | } |
| 3563 | |
| 3564 | if (eval->HeadTarget->IsDeviceLink()) { |
| 3565 | cmList list{ parameters.begin(), parameters.end() }; |
| 3566 | auto const DL_BEGIN = "<DEVICE_LINK>"_s; |
| 3567 | auto const DL_END = "</DEVICE_LINK>"_s; |
| 3568 | cm::erase_if(list, [&](std::string const& item) { |
| 3569 | return item == DL_BEGIN || item == DL_END; |
| 3570 | }); |
| 3571 | |
| 3572 | list.insert(list.begin(), static_cast<std::string>(DL_BEGIN)); |
| 3573 | list.push_back(static_cast<std::string>(DL_END)); |
| 3574 | |
| 3575 | return list.to_string(); |
| 3576 | } |
| 3577 | |
| 3578 | return std::string(); |
| 3579 | } |
| 3580 | } deviceLinkNode; |
| 3581 | |
| 3582 | namespace { |
nothing calls this directly
no test coverage detected