1.. _BuildingCompilerRT: 2 3=============== 4Building Compiler-RT 5=============== 6 7.. contents:: 8 :local: 9 10.. _build instructions: 11 12The instructions on this page are aimed at vendors who ship Compiler-RT as part of an 13operating system distribution, a toolchain or similar shipping vehicules. If you 14are a user merely trying to use Compiler-RT in your program, you most likely want to 15refer to your vendor's documentation, or to the general documentation for using 16LLVM, Clang, the various santizers, etc. 17 18CMake Options 19============= 20 21Here are some of the CMake variables that are used often, along with a 22brief explanation and LLVM-specific notes. For full documentation, check the 23CMake docs or execute ``cmake --help-variable VARIABLE_NAME``. 24 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. 29 30**CMAKE_INSTALL_PREFIX**:PATH 31 Path where LLVM will be installed if "make install" is invoked or the 32 "INSTALL" target is built. 33 34**CMAKE_CXX_COMPILER**:STRING 35 The C++ compiler to use when building and testing Compiler-RT. 36 37 38.. _compiler-rt-specific options: 39 40Compiler-RT specific options 41----------------------- 42 43.. option:: COMPILER_RT_INSTALL_PATH:PATH 44 45 **Default**: ```` (empty relative path) 46 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. 54 55.. option:: COMPILER_RT_INSTALL_LIBRARY_DIR:PATH 56 57 **Default**: ``lib`` 58 59 Path where built Compiler-RT libraries should be installed. If a relative 60 path, relative to ``COMPILER_RT_INSTALL_PATH``. 61 62.. option:: COMPILER_RT_INSTALL_BINARY_DIR:PATH 63 64 **Default**: ``bin`` 65 66 Path where built Compiler-RT executables should be installed. If a relative 67 path, relative to ``COMPILER_RT_INSTALL_PATH``. 68 69.. option:: COMPILER_RT_INSTALL_INCLUDE_DIR:PATH 70 71 **Default**: ``include`` 72 73 Path where Compiler-RT headers should be installed. If a relative 74 path, relative to ``COMPILER_RT_INSTALL_PATH``. 75 76.. option:: COMPILER_RT_INSTALL_DATA_DIR:PATH 77 78 **Default**: ``share`` 79 80 Path where Compiler-RT data should be installed. If a relative 81 path, relative to ``COMPILER_RT_INSTALL_PATH``. 82 83.. _LLVM-specific variables: 84 85LLVM-specific options 86--------------------- 87 88.. option:: LLVM_LIBDIR_SUFFIX:STRING 89 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``. 93