diff options
| author | Alexey Samsonov <samsonov@google.com> | 2014-03-13 09:31:36 +0000 |
|---|---|---|
| committer | Alexey Samsonov <samsonov@google.com> | 2014-03-13 09:31:36 +0000 |
| commit | 32956d651a1f1d9d01600a893bdcea74e05ad646 (patch) | |
| tree | 11eb5bfae6d2c592efb4b95660360cfc491cbf98 /compiler-rt/cmake/Modules/CompilerRTUtils.cmake | |
| parent | 38a93aaaa1819a7ba8c4277c32d93d10d9d45a96 (diff) | |
| download | bcm5719-llvm-32956d651a1f1d9d01600a893bdcea74e05ad646.tar.gz bcm5719-llvm-32956d651a1f1d9d01600a893bdcea74e05ad646.zip | |
[CMake] Make append_if semantics similar to those used in LLVM
llvm-svn: 203773
Diffstat (limited to 'compiler-rt/cmake/Modules/CompilerRTUtils.cmake')
| -rw-r--r-- | compiler-rt/cmake/Modules/CompilerRTUtils.cmake | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake index 6c05a15d920..b8eef90bb41 100644 --- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake @@ -37,15 +37,18 @@ macro(pythonize_bool var) endif() endmacro() -macro(append_if list condition var) - if (${condition}) - list(APPEND ${list} ${var}) +# Appends value to all lists in ARGN, if the condition is true. +macro(append_if condition value) + if(${condition}) + foreach(list ${ARGN}) + list(APPEND ${list} ${value}) + endforeach() endif() endmacro() macro(append_no_rtti_flag list) - append_if(${list} COMPILER_RT_HAS_FNO_RTTI_FLAG -fno-rtti) - append_if(${list} COMPILER_RT_HAS_GR_FLAG /GR-) + append_if(COMPILER_RT_HAS_FNO_RTTI_FLAG -fno-rtti ${list}) + append_if(COMPILER_RT_HAS_GR_FLAG /GR- ${list}) endmacro() macro(add_definitions_if condition) |

