This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix find_program() result check when searching for gRPC
ClosedPublic

Authored by ArcsinX on Aug 14 2020, 12:31 AM.

Details

Summary

find_program(<VAR> ...) sets <VAR> to <VAR>-NOTFOUND if nothing was found.
So we need to compare <VAR> with "<VAR>-NOTFOUND" or just use if([NOT] <VAR>), because if(<VAR>) is false if <VAR> ends in the suffix -NOTFOUND.

Diff Detail

Event Timeline

ArcsinX created this revision.Aug 14 2020, 12:31 AM
ArcsinX requested review of this revision.Aug 14 2020, 12:31 AM
kbobyrev accepted this revision.Aug 14 2020, 1:10 AM

Ah, good catch, thank you! Alternatively there seems to be Package_FOUND variable but what your propose is cleaner.

Do you want me to land the patch for you?

This revision is now accepted and ready to land.Aug 14 2020, 1:10 AM

Do you want me to land the patch for you?

I already have commit access, thank you.

This revision was landed with ongoing or failed builds.Aug 14 2020, 1:34 AM
This revision was automatically updated to reflect the committed changes.