[llvm] [CMake] Create generic runtimes targets as needed (PR #76096)

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 18:55:58 PST 2023


petrhosek wrote:

I encountered this when trying to enable `libc` for a single (baremetal) subbuild, and as such I don't want to put it in the `LLVM_ENABLE_RUNTIMES` global variable (that would result in the Darwin subbuild trying to build `libc` which is going to fail), but that means the generic `libc` target won't be created and the latter attempt at adding the dependency is going to fail here: https://github.com/llvm/llvm-project/blob/61b58123a3137323d6876006a6171d42e5e03cc1/llvm/runtimes/CMakeLists.txt#L394

More generally, I think that the global `LLVM_ENABLE_RUNTIMES` variable should only apply to the default subbuild: https://github.com/llvm/llvm-project/blob/61b58123a3137323d6876006a6171d42e5e03cc1/llvm/runtimes/CMakeLists.txt#L211
All other subbuilds should use `RUNTIME_<target>_LLVM_ENABLE_RUNTIMES`: https://github.com/llvm/llvm-project/blob/61b58123a3137323d6876006a6171d42e5e03cc1/llvm/runtimes/CMakeLists.txt#L271

https://github.com/llvm/llvm-project/pull/76096


More information about the llvm-commits mailing list