xref: /aosp_15_r20/external/llvm/cmake/modules/AddLLVMDefinitions.cmake (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker# There is no clear way of keeping track of compiler command-line
2*9880d681SAndroid Build Coastguard Worker# options chosen via `add_definitions', so we need our own method for
3*9880d681SAndroid Build Coastguard Worker# using it on tools/llvm-config/CMakeLists.txt.
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker# Beware that there is no implementation of remove_llvm_definitions.
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workermacro(add_llvm_definitions)
8*9880d681SAndroid Build Coastguard Worker  # We don't want no semicolons on LLVM_DEFINITIONS:
9*9880d681SAndroid Build Coastguard Worker  foreach(arg ${ARGN})
10*9880d681SAndroid Build Coastguard Worker    if(DEFINED LLVM_DEFINITIONS)
11*9880d681SAndroid Build Coastguard Worker      set(LLVM_DEFINITIONS "${LLVM_DEFINITIONS} ${arg}")
12*9880d681SAndroid Build Coastguard Worker    else()
13*9880d681SAndroid Build Coastguard Worker      set(LLVM_DEFINITIONS ${arg})
14*9880d681SAndroid Build Coastguard Worker    endif()
15*9880d681SAndroid Build Coastguard Worker  endforeach(arg)
16*9880d681SAndroid Build Coastguard Worker  add_definitions( ${ARGN} )
17*9880d681SAndroid Build Coastguard Workerendmacro(add_llvm_definitions)
18