diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt index 27d8bc5bdae3..debc84786912 100644 --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -214,12 +214,18 @@ macro(unwind_append_if list condition var) endif() endmacro() -macro(add_target_flags_if condition var) +macro(add_target_flags) + foreach(value ${ARGN}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${value}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${value}") + list(APPEND LIBUNWIND_COMPILE_FLAGS ${value}) + list(APPEND LIBUNWIND_LINK_FLAGS ${value}) + endforeach() +endmacro() + +macro(add_target_flags_if condition) if (${condition}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${var}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${var}") - list(APPEND LIBUNWIND_COMPILE_FLAGS ${var}) - list(APPEND LIBUNWIND_LINK_FLAGS ${var}) + add_target_flags(${ARGN}) endif() endmacro()