| 5682 | ShellPathNode() {} // NOLINT(modernize-use-equals-default) |
| 5683 | |
| 5684 | std::string Evaluate( |
| 5685 | std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval, |
| 5686 | GeneratorExpressionContent const* content, |
| 5687 | cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override |
| 5688 | { |
| 5689 | cmList list_in{ parameters.front() }; |
| 5690 | if (list_in.empty()) { |
| 5691 | reportError(eval, content->GetOriginalExpression(), |
| 5692 | "\"\" is not an absolute path."); |
| 5693 | return std::string(); |
| 5694 | } |
| 5695 | cmStateSnapshot snapshot = eval->Context.LG->GetStateSnapshot(); |
| 5696 | cmOutputConverter converter(snapshot); |
| 5697 | char const* separator = snapshot.GetState()->UseWindowsShell() ? ";" : ":"; |
| 5698 | std::vector<std::string> list_out; |
| 5699 | list_out.reserve(list_in.size()); |
| 5700 | for (auto const& in : list_in) { |
| 5701 | if (!cmSystemTools::FileIsFullPath(in)) { |
| 5702 | reportError(eval, content->GetOriginalExpression(), |
| 5703 | cmStrCat('"', in, "\" is not an absolute path.")); |
| 5704 | return std::string(); |
| 5705 | } |
| 5706 | list_out.emplace_back(converter.ConvertDirectorySeparatorsForShell(in)); |
| 5707 | } |
| 5708 | return cmJoin(list_out, separator); |
| 5709 | } |
| 5710 | } shellPathNode; |
| 5711 | |
| 5712 | cmGeneratorExpressionNode const* cmGeneratorExpressionNode::GetNode( |
nothing calls this directly
no test coverage detected