https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/152302
As promised by the current warning message: CMake Warning at CMakeLists.txt:209 (message): Using LLVM_ENABLE_PROJECTS=openmp is deprecated now, and will become a fatal error in the LLVM 21 release. Please use -DLLVM_ENABLE_RUNTIMES=openmp or see the instructions at https://openmp.llvm.org/ for building the runtimes. I have changed this to: CMake Warning at CMakeLists.txt:202 (message): Using LLVM_ENABLE_PROJECTS=openmp is no longer supported. Please use -DLLVM_ENABLE_RUNTIMES=openmp or see the instructions at https://openmp.llvm.org/ for building the runtimes. I removed the check for offload because offload never hits the warning, it errors earlier with: CMake Error at CMakeLists.txt:143 (MESSAGE): offload isn't a known project: bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libclc;lld;lldb;mlir;openmp;polly;flang;libc. Did you mean to enable it as a runtime in LLVM_ENABLE_RUNTIMES? We could remove the FATAL_ERRORs entirely but I thought leaving them in 21.x and removing them on main made more sense. So this change is specifically for 21.x. >From afc78ab30f7ec81b7163fb4c3928cb08bd902766 Mon Sep 17 00:00:00 2001 From: David Spickett <david.spick...@linaro.org> Date: Wed, 6 Aug 2025 12:35:05 +0000 Subject: [PATCH] [llvm][cmake] Turn runtime in PROJECTS warnings into FATAL_ERROR As promised by the current warning message: CMake Warning at CMakeLists.txt:209 (message): Using LLVM_ENABLE_PROJECTS=openmp is deprecated now, and will become a fatal error in the LLVM 21 release. Please use -DLLVM_ENABLE_RUNTIMES=openmp or see the instructions at https://openmp.llvm.org/ for building the runtimes. I have changed this to: CMake Warning at CMakeLists.txt:202 (message): Using LLVM_ENABLE_PROJECTS=openmp is no longer supported. Please use -DLLVM_ENABLE_RUNTIMES=openmp or see the instructions at https://openmp.llvm.org/ for building the runtimes. I removed the check for offload because offload never hits the warning, it errors earlier with: CMake Error at CMakeLists.txt:143 (MESSAGE): offload isn't a known project: bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libclc;lld;lldb;mlir;openmp;polly;flang;libc. Did you mean to enable it as a runtime in LLVM_ENABLE_RUNTIMES? We could remove the FATAL_ERRORs entirely but I thought leaving them in 21.x and removing them on main made more sense. So this change is specifically for 21.x. --- llvm/CMakeLists.txt | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 3f8201fa426fe..a16fb31cd320c 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -180,29 +180,20 @@ if ("flang" IN_LIST LLVM_ENABLE_PROJECTS) endif() if ("libc" IN_LIST LLVM_ENABLE_PROJECTS) - message(WARNING "Using LLVM_ENABLE_PROJECTS=libc is deprecated. Please use " + message(FATAL_ERROR "Using LLVM_ENABLE_PROJECTS=libc is no longer supported. Please use " "-DLLVM_ENABLE_RUNTIMES=libc or see the instructions at " "https://libc.llvm.org/ for building the runtimes.") endif() if ("compiler-rt" IN_LIST LLVM_ENABLE_PROJECTS) - message(WARNING "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 " + message(FATAL_ERROR "Using LLVM_ENABLE_PROJECTS=compiler-rt is no longer supported. " + "Please use -DLLVM_ENABLE_RUNTIMES=compiler-rt or see the instructions at " "https://compiler-rt.llvm.org/ for building the runtimes.") endif() -if ("offload" IN_LIST LLVM_ENABLE_PROJECTS) - message(WARNING "Using LLVM_ENABLE_PROJECTS=offload is deprecated now, and will " - "become a fatal error in the LLVM 21 release. Please use " - "-DLLVM_ENABLE_RUNTIMES=offload or see the instructions at " - "https://openmp.llvm.org/ for building the runtimes.") -endif() - if ("openmp" IN_LIST LLVM_ENABLE_PROJECTS) - message(WARNING "Using LLVM_ENABLE_PROJECTS=openmp is deprecated now, and will " - "become a fatal error in the LLVM 21 release. Please use " - "-DLLVM_ENABLE_RUNTIMES=openmp or see the instructions at " + message(FATAL_ERROR "Using LLVM_ENABLE_PROJECTS=openmp is no longer supported. " + "Please use -DLLVM_ENABLE_RUNTIMES=openmp or see the instructions at " "https://openmp.llvm.org/ for building the runtimes.") endif() @@ -213,9 +204,8 @@ if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES) endif () if ("libclc" IN_LIST LLVM_ENABLE_PROJECTS) - message(WARNING "Using LLVM_ENABLE_PROJECTS=libclc is deprecated now, and will " - "become a fatal error in the LLVM 21 release. Please use " - "-DLLVM_ENABLE_RUNTIMES=libclc or see the instructions at " + message(FATAL_ERROR "Using LLVM_ENABLE_PROJECTS=libclc is no longer supported. " + "Please use -DLLVM_ENABLE_RUNTIMES=libclc or see the instructions at " "https://libclc.llvm.org/ for building the runtimes.") endif() _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits