Closed mstorsjo closed 3 years ago
Ping
Ping @tkrasnukha
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.
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.