Skip to content

docs/GettingStarted: document linker-related cmake options #80932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions llvm/docs/CMake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ variable and type on the CMake command line:

$ cmake -DVARIABLE:TYPE=value path/to/llvm/source

.. _cmake_frequently_used_variables:

Frequently-used CMake variables
-------------------------------

Expand Down
86 changes: 17 additions & 69 deletions llvm/docs/GettingStarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -540,75 +540,23 @@ Variables are passed to ``cmake`` on the command line using the format
``-D<variable name>=<value>``. The following variables are some common options
used by people developing LLVM.

+-------------------------+----------------------------------------------------+
| Variable | Purpose |
+=========================+====================================================+
| CMAKE_C_COMPILER | Tells ``cmake`` which C compiler to use. By |
| | default, this will be /usr/bin/cc. |
+-------------------------+----------------------------------------------------+
| CMAKE_CXX_COMPILER | Tells ``cmake`` which C++ compiler to use. By |
| | default, this will be /usr/bin/c++. |
+-------------------------+----------------------------------------------------+
| CMAKE_BUILD_TYPE | Tells ``cmake`` what type of build you are trying |
| | to generate files for. Valid options are Debug, |
| | Release, RelWithDebInfo, and MinSizeRel. Default |
| | is Debug. |
+-------------------------+----------------------------------------------------+
| CMAKE_INSTALL_PREFIX | Specifies the install directory to target when |
| | running the install action of the build files. |
+-------------------------+----------------------------------------------------+
| Python3_EXECUTABLE | Forces CMake to use a specific Python version by |
| | passing a path to a Python interpreter. By default |
| | the Python version of the interpreter in your PATH |
| | is used. |
+-------------------------+----------------------------------------------------+
| LLVM_TARGETS_TO_BUILD | A semicolon delimited list controlling which |
| | targets will be built and linked into llvm. |
| | The default list is defined as |
| | ``LLVM_ALL_TARGETS``, and can be set to include |
| | out-of-tree targets. The default value includes: |
| | ``AArch64, AMDGPU, ARM, AVR, BPF, Hexagon, Lanai, |
| | Mips, MSP430, NVPTX, PowerPC, RISCV, Sparc, |
| | SystemZ, WebAssembly, X86, XCore``. Setting this |
| | to ``"host"`` will only compile the host |
| | architecture (e.g. equivalent to specifying ``X86``|
| | on an x86 host machine) can |
| | significantly speed up compile and test times. |
+-------------------------+----------------------------------------------------+
| LLVM_ENABLE_DOXYGEN | Build doxygen-based documentation from the source |
| | code This is disabled by default because it is |
| | slow and generates a lot of output. |
+-------------------------+----------------------------------------------------+
| LLVM_ENABLE_PROJECTS | A semicolon-delimited list selecting which of the |
| | other LLVM subprojects to additionally build. (Only|
| | effective when using a side-by-side project layout |
| | e.g. via git). The default list is empty. Can |
| | include: clang, clang-tools-extra, |
| | cross-project-tests, flang, libc, libclc, lld, |
| | lldb, mlir, openmp, polly, or pstl. |
+-------------------------+----------------------------------------------------+
| LLVM_ENABLE_RUNTIMES | A semicolon-delimited list selecting which of the |
| | runtimes to build. (Only effective when using the |
| | full monorepo layout). The default list is empty. |
| | Can include: compiler-rt, libc, libcxx, libcxxabi, |
| | libunwind, or openmp. |
+-------------------------+----------------------------------------------------+
| LLVM_ENABLE_SPHINX | Build sphinx-based documentation from the source |
| | code. This is disabled by default because it is |
| | slow and generates a lot of output. Sphinx version |
| | 1.5 or later recommended. |
+-------------------------+----------------------------------------------------+
| LLVM_BUILD_LLVM_DYLIB | Generate libLLVM.so. This library contains a |
| | default set of LLVM components that can be |
| | overridden with ``LLVM_DYLIB_COMPONENTS``. The |
| | default contains most of LLVM and is defined in |
| | ``tools/llvm-shlib/CMakelists.txt``. This option is|
| | not available on Windows. |
+-------------------------+----------------------------------------------------+
| LLVM_OPTIMIZED_TABLEGEN | Builds a release tablegen that gets used during |
| | the LLVM build. This can dramatically speed up |
| | debug builds. |
+-------------------------+----------------------------------------------------+
* ``CMAKE_C_COMPILER``
* ``CMAKE_CXX_COMPILER``
* ``CMAKE_BUILD_TYPE``
* ``CMAKE_INSTALL_PREFIX``
* ``Python3_EXECUTABLE``
* ``LLVM_TARGETS_TO_BUILD``
* ``LLVM_ENABLE_PROJECTS``
* ``LLVM_ENABLE_RUNTIMES``
* ``LLVM_ENABLE_DOXYGEN``
* ``LLVM_ENABLE_SPHINX``
* ``LLVM_BUILD_LLVM_DYLIB``
* ``LLVM_LINK_LLVM_DYLIB``
* ``LLVM_PARALLEL_LINK_JOBS``
* ``LLVM_OPTIMIZED_TABLEGEN``

See :ref:`the list of frequently-used CMake variables <cmake_frequently_used_variables>`
for more information.

To configure LLVM, follow these steps:

Expand Down