diff --git a/llvm/docs/GettingStarted.rst b/llvm/docs/GettingStarted.rst --- a/llvm/docs/GettingStarted.rst +++ b/llvm/docs/GettingStarted.rst @@ -104,6 +104,42 @@ configuring and compiling LLVM. Go to `Directory Layout`_ to learn about the layout of the source code tree. +Stand-alone Builds +------------------ +Stand-alone builds allow you to build a sub-project against a pre-built +version of the clang or llvm libraries that is already present on your +system. + +You can use the source code from a standard checkout of the llvm-project +(as described above) to do stand-alone builds, but you may also build +from a :ref:`sparse checkout` or from the +tarballs available on the `releases `_ +page. + +To configure a project for a stand-alone build, invoke CMake like this: + +.. code-block:: console + + cmake -G Ninja -S $subproj -B $buildir \ + -DLLVM_EXTERNAL_LIT=/path/to/lit \ + -DLLVM_ROOT=/path/to/llvm/install/prefix + +LLVM_ROOT should point to the prefix of your llvm installation, so for example, +if llvm is installed into /usr/bin and /usr/lib64, then you should pass +-DLLVM_ROOT=/usr/. Both the LLVM_ROOT and LLVM_EXTERNAL_LIT options +are required to do stand-alone builds for all sub-projects. Additional required +options for each sub-project can be found in the table below. + +The ``check-$subproj`` and ``install`` build targets are supported for the +sub-projects listed in the table below. + +============ ======================== ====================== +Sub-Project Required Sub-Directories Required CMake Options +============ ======================== ====================== +clang clang, cmake CLANG_INCLUDE_TESTS=ON (Required for check-clang only) +============ ======================== ====================== + + Requirements ============