Merge bitcoin/bitcoin#31231: cmake: Fix IF_CHECK_PASSED option handling

97a18c8545 cmake: Fix `IF_CHECK_PASSED` option handling (Hennadii Stepanov)

Pull request description:

  `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 https://github.com/bitcoin/bitcoin/pull/30861.

  No current CMake code is affected by this bug.

ACKs for top commit:
  theuni:
    utACK 97a18c8545

Tree-SHA512: d2556ca38c35a8992175e9f948c2028a789e71c2b2d5fdf365b31710c8ed3d5edf5d0363853c5d750d29abb58cfda3c78cdc2971a627e5b4c61aca4ec2a33356
This commit is contained in:
merge-script 2024-12-06 10:15:56 +00:00
commit eb2ebe6f30
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
2 changed files with 4 additions and 2 deletions

View file

@ -72,7 +72,8 @@ function(try_append_cxx_flags flags)
target_compile_options(${TACXXF_TARGET} INTERFACE ${TACXXF_IF_CHECK_PASSED})
endif()
if(DEFINED TACXXF_VAR)
string(STRIP "${${TACXXF_VAR}} ${TACXXF_IF_CHECK_PASSED}" ${TACXXF_VAR})
list(JOIN TACXXF_IF_CHECK_PASSED " " flags_if_check_passed_as_string)
string(STRIP "${${TACXXF_VAR}} ${flags_if_check_passed_as_string}" ${TACXXF_VAR})
endif()
else()
if(DEFINED TACXXF_TARGET)

View file

@ -48,7 +48,8 @@ function(try_append_linker_flag flag)
target_link_options(${TALF_TARGET} INTERFACE ${TALF_IF_CHECK_PASSED})
endif()
if(DEFINED TALF_VAR)
string(STRIP "${${TALF_VAR}} ${TALF_IF_CHECK_PASSED}" ${TALF_VAR})
list(JOIN TALF_IF_CHECK_PASSED " " flags_if_check_passed_as_string)
string(STRIP "${${TALF_VAR}} ${flags_if_check_passed_as_string}" ${TALF_VAR})
endif()
else()
if(DEFINED TALF_TARGET)