-
Notifications
You must be signed in to change notification settings - Fork 15.2k
cmake: Avoid using if(TARGET x AND TARGET y) #159707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think the issue is that both variables are empty strings. So |
Undefined value is not a target, which works fine |
This does indeed fix the build errors - but it doesn't seem to do the right thing; if building with So what's the intended purpose of adding these TARGET checks in the first place? |
I was trying to fix the last build error, and figured the targets didn't exist. It turns out they do exist, just aren't executable. so yes probably should drop the target checks |
This appears to not work, and the documentation only has examples with a single target checked at a time.
e09e8c9
to
f6a90e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me, thanks.
It's still unclear to me in which cases these variables actually would end up empty, but this looks safe (and works in my build config as well).
Thank you, I can confirm this patch fixes my builds. |
This appears to not work, and the documentation only has
examples with a single target checked at a time.