[PATCH] D71737: [CMake][runtimes] Skip the generic target variable if named matches
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 20 17:09:27 PST 2019
phosek abandoned this revision.
phosek added a comment.
In D71737#1793355 <https://reviews.llvm.org/D71737#1793355>, @JamesNagurne wrote:
> This foreach loop goes over each variable, yes?
> If so, then I'm not sure this change does what is required.
>
> If the list variableNames is:
>
> RUNTIMES_target+multi_XYZ
> RUNTIMES_target_XYZ
>
> This loop will:
>
> 1. variableName = RUNTIMES_target+multi_XYZ
> 2. Check if {name} matches, it does
> 3. Add -DXYZ=value to the list
> 4. variableName = RUNTIMES_target_XYZ
> 5. Check if {name} matches, it doesn't
> 6. Else, check if {target} matches, it does
> 7. Add -DXYZ=value to the list, overriding the expected value in 3 above
>
> Edit: That is to say, only one path will ever be executed per iteration of this loop, so the addition of else() doesn't change the behavior.
You're right, this doesn't address the issue. I was hoping to come up with a way to short circuit the iteration if a more specific variable was already added, but it's difficult to track that. Given that, your solution is probably the easiest one so let's go with that.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71737/new/
https://reviews.llvm.org/D71737
More information about the llvm-commits
mailing list