cmake: Fix IF_CHECK_PASSED option handling #31231

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:241106-cmake-fix changing 2 files +4 −2
  1. hebasto commented at 9:01 am on November 6, 2024: member

    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.

  2. cmake: Fix `IF_CHECK_PASSED` option handling
    `IF_CHECK_PASSED` is a multi-value keyword, resulting in a list value.
    Convert it to a string before applying any `string()` command.
    97a18c8545
  3. hebasto added the label Bug on Nov 6, 2024
  4. hebasto added the label Build system on Nov 6, 2024
  5. DrahtBot commented at 9:02 am on November 6, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31231.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  6. theuni approved
  7. theuni commented at 8:24 pm on December 3, 2024: member

    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.

  8. hebasto commented at 8:34 pm on December 3, 2024: member

    @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.

  9. fanquake merged this on Dec 6, 2024
  10. fanquake closed this on Dec 6, 2024

  11. hebasto deleted the branch on Dec 6, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-30 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me