IF_CHECK_PASSED
is a multi-value keyword, resulting in a list value. Convert it to a string before applying any string()
command.
Split from #30861.
No current CMake code is affected by this bug.
IF_CHECK_PASSED
option handling
#31231
`IF_CHECK_PASSED` is a multi-value keyword, resulting in a list value.
Convert it to a string before applying any `string()` command.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31231.
See the guideline for information on the review process. A summary of reviews will appear here.
utACK 97a18c85458b898fe5e3abda9528a2de442766ad
Confirmed that this indeed a list.
To other reviewers: the string(STRIP "${foo} ${bar}" ${baz})
syntax is confusing. It’s just concatenating foo and bar and storing it in baz with no whitespace at the beginning or end.
@hebasto Is there a way to get CMake to warn us about these? It seems like it should know that we were attempting a string operation on a list.
@hebasto Is there a way to get CMake to warn us about these? It seems like it should know that we were attempting a string operation on a list.
I’m not aware of any such embedded functionality. CMake’s internally represents both “strings” and “lists” as strings. A list can safely be treated as a string when it contains fewer than two elements.
Labels
Bug
Build system