[CMake][libunwind] Define add_target_flags which is missing

It's use was introduced in r353084 but its definition is missing.

Differential Revision: https://reviews.llvm.org/D58745

llvm-svn: 355142
This commit is contained in:
Petr Hosek 2019-02-28 21:38:59 +00:00
parent 7818144ff3
commit dc1b8e9f44
1 changed files with 11 additions and 5 deletions

View File

@ -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()