| 3773 | int NumExpectedParameters() const override { return OneOrMoreParameters; } |
| 3774 | |
| 3775 | std::string Evaluate( |
| 3776 | std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval, |
| 3777 | GeneratorExpressionContent const* content, |
| 3778 | cmGeneratorExpressionDAGChecker* /*dagCheckerParent*/) const override |
| 3779 | { |
| 3780 | if (parameters.size() > 2) { |
| 3781 | reportError(eval, content->GetOriginalExpression(), |
| 3782 | "$<SOURCE_EXISTS:...> expression requires at most two " |
| 3783 | "parameters."); |
| 3784 | return std::string{}; |
| 3785 | } |
| 3786 | |
| 3787 | if (parameters[0].empty()) { |
| 3788 | reportError(eval, content->GetOriginalExpression(), |
| 3789 | "$<SOURCE_EXISTS:src> expression requires a " |
| 3790 | "non-empty source name."); |
| 3791 | return std::string{}; |
| 3792 | } |
| 3793 | |
| 3794 | cmSourceFile* sourceFile = nullptr; |
| 3795 | if (!GetSourceFile(cmMakeRange(parameters), eval, content, sourceFile)) { |
| 3796 | return std::string{}; |
| 3797 | } |
| 3798 | |
| 3799 | return sourceFile ? "1" : "0"; |
| 3800 | } |
| 3801 | } sourceExistsNode; |
| 3802 | |
| 3803 | static const struct SourcePropertyNode : public cmGeneratorExpressionNode |
nothing calls this directly
no test coverage detected