Skip to content

Commit

Permalink
cmake: Fix IF_CHECK_PASSED option handling
Browse files Browse the repository at this point in the history
`IF_CHECK_PASSED` is a multi-value keyword, resulting in a list value.
Convert it to a string before applying any `string()` command.
  • Loading branch information
hebasto committed Nov 6, 2024
1 parent 65b1941 commit 97a18c8
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 97a18c8

Please sign in to comment.