[PATCH] D119383: [clang][CMake] Add a warning about the Standalone build being deprecated

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 9 15:48:18 PST 2022


MaskRay created this revision.
MaskRay added reviewers: aaron.ballman, mstorsjo, rjmccall, rsmith.
Herald added a subscriber: mgorny.
MaskRay requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

For me, `cmake -Hclang -B/path/to/build` currently fails with

  CMake Error at CMakeLists.txt:122 (include):
    include could not find requested file:
  
      GetErrcMessages
  
  -- Found Python3: /usr/bin/python3.9 (found version "3.9.9") found components: Interpreter
  CMake Error at /home/maskray/llvm/llvm/utils/llvm-lit/CMakeLists.txt:13 (make_paths_relative):
    Unknown CMake command "make_paths_relative".

Keeping the Standalone build working is now quite a bit of hassle and to
the best of my knowledge not any active contributor typically does. Let's
follow libc++/libc++abi/libunwind (D119341 <https://reviews.llvm.org/D119341>), deprecate and remove the build
mode. We will be able to remove much code related to `CLANG_BUILT_STANDALONE`.

To keep the disruption minimum, use `message(WARNING ...` for release/14.x and
`message(FATAL_ERROR ...` for main.

Similar to D119380 <https://reviews.llvm.org/D119380> for lld.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119383

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===================================================================
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -5,6 +5,8 @@
 if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
   project(Clang)
   set(CLANG_BUILT_STANDALONE TRUE)
+  message(WARNING "The Standalone build is deprecated in this release. Please
+    use -DLLVM_ENABLE_PROJECTS='...;clang;...' to build clang.")
 endif()
 
 # Must go below project(..)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119383.407327.patch
Type: text/x-patch
Size: 457 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220209/8188cc16/attachment.bin>


More information about the cfe-commits mailing list