[LLVMdev] compiler-rt's append_if definition breaks lldb build

Kuba Ober kuba at mareimbrium.org
Fri Mar 14 16:02:33 PDT 2014


In cmake projects, it seems that the scope of macros/functions is global.
Whichever definition is seen last, wins.

The incompatible assign_if definition in cmake/Modules/CompilerRTUtils.cmake
breaks the lldb project, since it so happens that lldb’s CMakeLists are processed
after compiler_rt.

* In compiler-rt, it’s expected that append_if operates on semicolon delimited
  strings, also known as cmake lists.

* In core llvm, and in lldb, it’s expected that append_if operates on space-delmited strings.

I propose to rename those macros/functions to list_append_if etc. If this is agreeable,
I’ll prepare a patch.

I dislike the “obvious” quick hack of moving the projects *after* tools in the main
CMakeLists.txt.

I think it must be a matter of policy to treat the cmake function/macro namespace as global
across the entire project. I’m willing to write a script to check for this, so that people
reviewing patches could sanity-check without undue manual labor.

Cheers, Kuba Ober



More information about the llvm-dev mailing list