[llvm] [llvm][CMake] Introduce LLVM_RUNTIME_<project>_BUILD in CMake (PR #88934)

Michael Klemm via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 06:13:30 PDT 2024


mjklemm wrote:

> It should be moved to `runtimes/CMakeLists.txt`, not `llvm/runtimes/CMakeLists.txt`.

Hm.  When I do this, it does not seem that it is picked up and when adding a debugging message, CMake does not seem to go through `runtimes/CMakeList.txt`, but `llvm/runtimes/CMakeLists.txt` for a configuration like this:

```
cmake -DLLVM_ENABLE_PROJECTS="clang;flang;lld" -DLLVM_ENABLE_RUNTIMES="openmp" [...] ../llvm
```

So, if I correctly understand your explanation above, then I'm doing a bootstrapping build with the above command line.  I have to use a command line like this to trigger the code in `runtimes/CMakefile.txt`:

```
cmake -DLLVM_ENABLE_RUNTIMES="openmp" [...] ../runtimes
```

So, a bootstrapping build simply configures the request to build a runtime via `llvm/runtimes/CMakeLists.txt` and then, when actually building, invokes CMake with a runtime build (using a command line like the 2nd one and C/C++ compiler set to Clang), which in turn triggers `runtime/CMakeLists.txt`? Is this thinking remotely correct?

Because then it would seem like code would need to be duplicated (or be moved to a CMake file that can be included in both `llvm/runtimes` and `runtimes`).  Because only that would allow a bootstrapping build to detect that a particular has been requested to, say, enable a bunch of LIT tests.  Or, alternatively, even have `LLVM_RUNTIME_<project>_BUILD` and `LLVM_BOOTSTRAP_<project>_BUILD` to distinguish the two variants of these builds to enable other parts of the CMake files to detect either one.


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


More information about the llvm-commits mailing list