Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Are you sure / what issue or false warning do you see ?
According to CMake docs: https://cmake.org/cmake/help/latest/command/if.html#string
and the true constants are:
So by keeping the quotes, then setting
ALLOW_EMPTY
to one of the above should result in theif(NOT "y")
to become false and the warning not printed, but whenALLOW_EMPTY
is not set, a warning is printed.However, the proposed
if(NOT ${allow_empty})
will expand intoif(NOT )
ifALLOW_EMPTY
is not set which will evaluate to false, meaning default behavior will suddenly be to allow empty libraries.If a library is empty and the warning should be silenced, then that library should set the
ALLOW_EMPTY
property to true.Like this:
zephyr/lib/posix/CMakeLists.txt
Line 48 in 5876cc5
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.
Thank you for your review.
Somehow I mixed up my terminals and did not notice that my test did not produce the warning anymore where allow empty was not set.
Nevertheless, I still have the warning for modules that are empty. But the issue for that is somewhere else...