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
This commit is contained in:
Louis Dionne 2021-10-28 10:42:51 -04:00
parent 8e3de91c07
commit 2912f53699
3 changed files with 14 additions and 8 deletions

View File

@ -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})

View File

@ -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 <https://libcxx.llvm.org/BuildingLibcxx.html>`_.
Note: the list should not have duplicates with `LLVM_ENABLE_PROJECTS`.
The full list is:
``compiler-rt;libc;libcxx;libcxxabi;libunwind;openmp``

View File

@ -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