1 .. _BuildingCompilerRT:
10 .. _build instructions:
12 The instructions on this page are aimed at vendors who ship Compiler-RT as part of an
13 operating system distribution, a toolchain or similar shipping vehicles. If you
14 are a user merely trying to use Compiler-RT in your program, you most likely want to
15 refer to your vendor's documentation, or to the general documentation for using
16 LLVM, Clang, the various santizers, etc.
21 Here are some of the CMake variables that are used often, along with a
22 brief explanation and LLVM-specific notes. For full documentation, check the
23 CMake docs or execute ``cmake --help-variable VARIABLE_NAME``.
25 **CMAKE_BUILD_TYPE**:STRING
26 Sets the build type for ``make`` based generators. Possible values are
27 Release, Debug, RelWithDebInfo and MinSizeRel. On systems like Visual Studio
28 the user sets the build type with the IDE settings.
30 **CMAKE_INSTALL_PREFIX**:PATH
31 Path where LLVM will be installed if "make install" is invoked or the
32 "INSTALL" target is built.
34 **CMAKE_CXX_COMPILER**:STRING
35 The C++ compiler to use when building and testing Compiler-RT.
38 .. _compiler-rt-specific options:
40 Compiler-RT specific options
41 -----------------------
43 .. option:: COMPILER_RT_INSTALL_PATH:PATH
45 **Default**: ```` (empty relative path)
47 Prefix for directories where built Compiler-RT artifacts should be installed.
48 Can be an absolute path, like the default empty string, in which case it is
49 relative ``CMAKE_INSTALL_PREFIX``. If setting a relative path, make sure to
50 include the ``:PATH`` with your ``-D``, i.e. use
51 ``-DCOMPILER_RT_INSTALL_PATH:PATH=...`` not
52 ``-DCOMPILER_RT_INSTALL_PATH=...``, otherwise CMake will convert the
53 path to an absolute path.
55 .. option:: COMPILER_RT_INSTALL_LIBRARY_DIR:PATH
59 Path where built Compiler-RT libraries should be installed. If a relative
60 path, relative to ``COMPILER_RT_INSTALL_PATH``.
62 .. option:: COMPILER_RT_INSTALL_BINARY_DIR:PATH
66 Path where built Compiler-RT executables should be installed. If a relative
67 path, relative to ``COMPILER_RT_INSTALL_PATH``.
69 .. option:: COMPILER_RT_INSTALL_INCLUDE_DIR:PATH
71 **Default**: ``include``
73 Path where Compiler-RT headers should be installed. If a relative
74 path, relative to ``COMPILER_RT_INSTALL_PATH``.
76 .. option:: COMPILER_RT_INSTALL_DATA_DIR:PATH
78 **Default**: ``share``
80 Path where Compiler-RT data should be installed. If a relative
81 path, relative to ``COMPILER_RT_INSTALL_PATH``.
83 .. _LLVM-specific variables:
88 .. option:: LLVM_LIBDIR_SUFFIX:STRING
90 Extra suffix to append to the directory where libraries are to be
91 installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
92 to install libraries to ``/usr/lib64``.