[llvm] [CMake][NFC] Remove libc and compiler-rt from LLVM_ALL_PROJECTS to av… (PR #137317)

Wang Qiang via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 25 04:36:21 PDT 2025


https://github.com/ReVe1uv created https://github.com/llvm/llvm-project/pull/137317

[cmake] Remove libc and compiler-rt from LLVM_ALL_PROJECTS to avoid deprecated usage warning

CMake emits deprecation warnings when libc or compiler-rt are included via LLVM_ENABLE_PROJECTS.
These runtimes are intended to be built using LLVM_ENABLE_RUNTIMES instead, and this will become a hard error in LLVM 21.

This patch removes `libc` and `compiler-rt` from the LLVM_ALL_PROJECTS list, so that using
`-DLLVM_ENABLE_PROJECTS=all` will no longer include them and thus avoids the warning.

Users who wish to build libc or compiler-rt should use `LLVM_ENABLE_RUNTIMES` instead.

```
CMake Warning at CMakeLists.txt:154 (message):
  Using LLVM_ENABLE_PROJECTS=libc is deprecated now, and will become a fatal
  error in the LLVM 21 release.  Please use -DLLVM_ENABLE_RUNTIMES=libc or
  see the instructions at https://libc.llvm.org/ for building the runtimes.


CMake Warning at CMakeLists.txt:161 (message):
  Using LLVM_ENABLE_PROJECTS=compiler-rt is deprecated now, and will become a
  fatal error in the LLVM 21 release.  Please use
  -DLLVM_ENABLE_RUNTIMES=compiler-rt or see the instructions at
  https://compiler-rt.llvm.org/ for building the runtimes.
```


>From 3c7e5086b31f0bb5c086b6347a736f4e1ef1e6be Mon Sep 17 00:00:00 2001
From: Wang Qiang <wangqiang1 at kylinos.cn>
Date: Fri, 25 Apr 2025 19:31:06 +0800
Subject: [PATCH] [CMake][NFC] Remove libc and compiler-rt from
 LLVM_ALL_PROJECTS to avoid deprecated usage warning

---
 llvm/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index c690acc27fa74..6ff740e69290d 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -115,7 +115,7 @@ endif()
 # LLVM_EXTERNAL_${project}_SOURCE_DIR using LLVM_ALL_PROJECTS
 # This allows an easy way of setting up a build directory for llvm and another
 # one for llvm+clang+... using the same sources.
-set(LLVM_ALL_PROJECTS "bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;lld;lldb;mlir;openmp;polly;pstl")
+set(LLVM_ALL_PROJECTS "bolt;clang;clang-tools-extra;cross-project-tests;libclc;lld;lldb;mlir;openmp;polly;pstl")
 if (${CMAKE_SYSTEM_NAME} MATCHES "AIX")
   # Disallow 'openmp' as a LLVM PROJECT on AIX as the supported way is to use
   # LLVM_ENABLE_RUNTIMES.



More information about the llvm-commits mailing list