From 2912f53699da704246a3320b87bc526340a370d2 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Thu, 28 Oct 2021 10:42:51 -0400 Subject: [PATCH] Officially deprecate LLVM_ENABLE_PROJECTS for libc++, libc++abi and libunwind This updates the LLVM wide documentation for building LLVM and the runtimes and adds a CMake warning when folks specify libcxx, libcxxabi or libunwind in LLVM_ENABLE_PROJECTS, pointing them to the updated instructions for building the runtimes. Differential Revision: https://reviews.llvm.org/D112724 --- llvm/CMakeLists.txt | 6 ++++++ llvm/docs/CMake.rst | 11 ++++++----- llvm/docs/GettingStarted.rst | 5 ++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 67bc796..f07f29a 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -76,6 +76,12 @@ foreach(proj ${LLVM_ENABLE_PROJECTS}) MESSAGE(FATAL_ERROR "${proj} isn't a known project: ${LLVM_KNOWN_PROJECTS}") endif() endforeach() +foreach(proj "libcxx" "libcxxabi" "libunwind") + if (${proj} IN_LIST LLVM_ENABLE_PROJECTS) + message(WARNING "Using LLVM_ENABLE_PROJECTS=${proj} is deprecated now, please use -DLLVM_ENABLE_RUNTIMES=${proj} or " + "see the instructions at https://libcxx.llvm.org/BuildingLibcxx.html for building the runtimes.") + endif() +endforeach() if( LLVM_ENABLE_PROJECTS STREQUAL "all" ) set( LLVM_ENABLE_PROJECTS ${LLVM_ALL_PROJECTS}) diff --git a/llvm/docs/CMake.rst b/llvm/docs/CMake.rst index 658484f..72d303e 100644 --- a/llvm/docs/CMake.rst +++ b/llvm/docs/CMake.rst @@ -485,19 +485,20 @@ enabled sub-projects. Nearly all of these variable names begin with **LLVM_ENABLE_PROJECTS**:STRING Semicolon-separated list of projects to build, or *all* for building all - (clang, libcxx, libcxxabi, lldb, compiler-rt, lld, polly, etc) projects. - This flag assumes that projects are checked out side-by-side and not nested, - i.e. clang needs to be in parallel of llvm instead of nested in `llvm/tools`. + (clang, lldb, compiler-rt, lld, polly, etc) projects. This flag assumes + that projects are checked out side-by-side and not nested, i.e. clang + needs to be in parallel of llvm instead of nested in `llvm/tools`. This feature allows to have one build for only LLVM and another for clang+llvm using the same source checkout. The full list is: - ``clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;libcxx;libcxxabi;libunwind;lld;lldb;openmp;polly;pstl`` + ``clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;lld;lldb;openmp;polly;pstl`` **LLVM_ENABLE_RUNTIMES**:STRING Build libc++, libc++abi or other projects using that a just-built compiler. This is the correct way to build libc++ when putting together a toolchain. It will build the builtins separately from the other runtimes to preserve - correct dependency ordering. + correct dependency ordering. If you want to build the runtimes using a system + compiler, see the `libc++ documentation `_. Note: the list should not have duplicates with `LLVM_ENABLE_PROJECTS`. The full list is: ``compiler-rt;libc;libcxx;libcxxabi;libunwind;openmp`` diff --git a/llvm/docs/GettingStarted.rst b/llvm/docs/GettingStarted.rst index 521c001..d4df15d 100644 --- a/llvm/docs/GettingStarted.rst +++ b/llvm/docs/GettingStarted.rst @@ -63,11 +63,10 @@ This is an example workflow and configuration to get and build the LLVM source: * ``-DLLVM_ENABLE_PROJECTS='...'`` --- semicolon-separated list of the LLVM subprojects you'd like to additionally build. Can include any of: clang, - clang-tools-extra, libcxx, libcxxabi, libunwind, lldb, compiler-rt, lld, - polly, or cross-project-tests. + clang-tools-extra, lldb, compiler-rt, lld, polly, or cross-project-tests. For example, to build LLVM, Clang, libcxx, and libcxxabi, use - ``-DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi"``. + ``-DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi"``. * ``-DCMAKE_INSTALL_PREFIX=directory`` --- Specify for *directory* the full pathname of where you want the LLVM tools and libraries to be installed -- 2.7.4