-
Notifications
You must be signed in to change notification settings - Fork 65
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
Allow checking whether sanitizers are available #18
base: master
Are you sure you want to change the base?
Conversation
FindXXX packages are supposed to define a `<package name>_FOUND` variable which shall be set to `TRUE`. This is the only way to check whether `find_package` has worked gracefully (i.e., without `REQUIRED`).
@TheAssassin The Usually, FindPackageHandleStandardArgs will handle this. However, we have to define a logic when sanitizers are available (i.e. which components are required for saying they're available). I'll discuss this in #16. |
@alehaa I see your point. I'd say it makes only sense to set |
Found a way to check for it now: I'm working on implementing what I suggested in my last comment at the moment. |
Please see the discussion in #16. |
Updated the PR to use FindPackageHandleStandardArgs, which works fine in my tests. I'm not 100% sure how this The only annoyance left is that the function to check for the flags shows warnings. As it is run every time now, you should consider making those warnings status messages or, even better, remove them at all. All in all, I'm pretty satisfied with the new usage. |
You've changed the code in a way, that it'll always search for sanitizers, even if one doesn't want to use them. |
@alehaa That's the idea... finding out which sanitizers are available. |
No, the sanitizers should be searched on-demand, if the user enabled one of them via |
@alehaa that doesn't make sense, really. Why is it a problem to perform those tests? This CMake module should provide information on whether sanitizers are available, and then provide information which ones. That's how CMake modules work. |
That's right, but then we'll have to rework the messages to be displayed, otherwise one could get several warnings / errors if the compiler doesn't know anything about sanitizers. The user shouldn't be flooded with warnings, if he doesn't want to use sanitizers et all. |
@alehaa I think it is sufficient to just remove the warnings, as described in #18 (comment). I think hiding the tests themselves is wrong, it's better to give direct feedback to the user. You could introduce this with e.g.,
|
@alehaa if I'd remove those warnings, could we merge this, then? |
Hi, is there any progress on this PR? |
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.
I think this is the way to go.
Each sanitizer submodule should provide a way (XSan_FOUND) to tell whether if appropriate compiler flags were found. That way client project can warn when XSan_FOUND is not defined.
To be clear, I think this PR is worth a merge as it is now. |
…ry function Hopefully this will be fixed in arsenm/sanitizers-cmake#18
…_summary function Hopefully this will be fixed in arsenm/sanitizers-cmake#18
…_summary function Hopefully this will be fixed in arsenm/sanitizers-cmake#18
With ef28483 the variable |
FindXXX packages are supposed to define a
<package name>_FOUND
variable which shall be set toTRUE
. This is the only way to check whetherfind_package
has worked gracefully (i.e., withoutREQUIRED
).Fixes #16.