lldb-tools / lldb-mi

LLDB's machine interface driver
https://lldb.llvm.org
Other
165 stars 56 forks source link

[CMake] Split LLVM_DEFINITIONS before adding them #76

Closed mstorsjo closed 3 years ago

mstorsjo commented 3 years ago

add_definitions is meant to take multiple definitions in the form of a parameter that is a list. LLVM_DEFINITIONS is a string variable though. In practice, passing a string variable to add_definitions mostly works, except for the case when it starts with not only a plain -DFOO, but a define with a value, i.e. -DFOO=42. In the case of LLVM_DEFINITIONS starting with -DFOO=42 -DBAR, cmake ends up passing -DFOO="42 -DBAR" to the compiler, which isn't what was intended.

See https://gitlab.kitware.com/cmake/cmake/-/issues/22162 for discussions on the matter.

This matches the recently updated docs for how users of LLVM are supposed to use LLVM_DEFINITIONS in CMake, see https://github.com/llvm/llvm-project/commit/a2a65a5bae3c503d40c219ef9ba460b1fb34d1bf.

mstorsjo commented 3 years ago

Ping

mstorsjo commented 3 years ago

Ping @tkrasnukha

tkrasnukha commented 3 years ago

Hi Martin, sorry for not answering for a long time. Travis CI seems to be broken, and it is not possible to merge a PR until CI job succeeds. Currently I have neither enough time nor access to project settings to fix it.