Skip to content

Commit

Permalink
Merge bitcoin#31231: cmake: Fix IF_CHECK_PASSED option handling
Browse files Browse the repository at this point in the history
97a18c8 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 bitcoin#30861.

  No current CMake code is affected by this bug.

ACKs for top commit:
  theuni:
    utACK 97a18c8

Tree-SHA512: d2556ca38c35a8992175e9f948c2028a789e71c2b2d5fdf365b31710c8ed3d5edf5d0363853c5d750d29abb58cfda3c78cdc2971a627e5b4c61aca4ec2a33356
  • Loading branch information
fanquake committed Dec 6, 2024
2 parents 5b283fa + 97a18c8 commit eb2ebe6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmake/module/TryAppendCXXFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion cmake/module/TryAppendLinkerFlag.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eb2ebe6

Please sign in to comment.