Lines Matching +full:- +full:- +full:build +full:- +full:root

11 `CMake <http://www.cmake.org/>`_ is a cross-platform build-generator tool. CMake
12 does not build the project, it generates the files needed by your build tool
15 If you are really anxious about getting a functional LLVM build, go to the
18 `Options and variables`_ section is a reference for customizing your build. If
26 We use here the command-line, non-interactive CMake interface.
34 #. Create a build directory. Building LLVM in the source
37 .. code-block:: console
42 #. Execute this command in the shell replacing `path/to/llvm/source/root` with
43 the path to the root of your LLVM source tree:
45 .. code-block:: console
47 $ cmake path/to/llvm/source/root
51 for all build parameters. See the `Options and variables`_ section for
52 a list of build parameters that you can modify.
58 to build MinGW makefiles if you have a POSIX shell reachable through the PATH
59 environment variable, for instance. You can force CMake to use a given build
63 the build from the build directory:
65 .. code-block:: console
67 $ cmake --build .
69 The ``--build`` option tells ``cmake`` to invoke the underlying build
72 The underlying build tool can be invoked directly, of course, but
73 the ``--build`` option is portable.
75 #. After LLVM has finished building, install it from the build directory:
77 .. code-block:: console
79 $ cmake --build . --target install
81 The ``--target`` option with ``install`` parameter in addition to
82 the ``--build`` option tells ``cmake`` to build the ``install`` target.
86 build directory:
88 .. code-block:: console
90 $ cmake -DCMAKE_INSTALL_PREFIX=/tmp/llvm -P cmake_install.cmake
99 which you may need in your day-to-day usage.
103 --help`` for further help options.
105 CMake allows you to specify a build tool (e.g., GNU make, Visual Studio,
107 build tool to use, based on your environment. Once it has identified your
108 build tool, CMake uses the corresponding *Generator* to create files for your
109 build tool (e.g., Makefiles or Visual Studio or Xcode project files). You can
110 explicitly specify the generator with the command line option ``-G "Name of the
113 .. code-block:: console
115 $ cmake --help
119 Generators' names are case-sensitive, and may contain spaces. For this reason,
120 you should enter them exactly as they are listed in the ``cmake --help``
124 .. code-block:: console
126 $ cmake -G "Visual Studio 12" path/to/llvm/source/root
132 you must tell this to CMake with the ``-G`` option.
143 Variables customize how the build will be generated. Options are boolean
147 .. code-block:: console
149 $ cmake -DVARIABLE=value path/to/llvm/source
154 .. code-block:: console
156 $ cmake -UVARIABLE path/to/llvm/source
159 stored at the root of your build directory that is generated by ``cmake``.
166 .. code-block:: console
168 $ cmake -DVARIABLE:TYPE=value path/to/llvm/source
170 Frequently-used CMake variables
171 -------------------------------
174 brief explanation and LLVM-specific notes. For full documentation, consult the
175 CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``.
178 Sets the build type for ``make``-based generators. Possible values are
180 Visual Studio, you should use the IDE settings to set the build type.
188 installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
201 mingw-w64, but not when building with the Microsoft toolchain.
203 .. _LLVM-specific variables:
205 LLVM-specific variables
206 -----------------------
209 Semicolon-separated list of targets to build, or *all* for building all
210 targets. Case-sensitive. Defaults to *all*. Example:
211 ``-DLLVM_TARGETS_TO_BUILD="X86;PowerPC"``.
214 Build LLVM tools. Defaults to ON. Targets for building each tool are generated
215 in any case. You can build a tool separately by invoking its target. For
216 example, you can build *llvm-as* with a Makefile-based system by executing *make
217 llvm-as* at the root of your build directory.
220 Generate build targets for the LLVM tools. Defaults to ON. You can use this
221 option to disable the generation of build targets for the LLVM tools.
224 Build LLVM examples. Defaults to OFF. Targets for building each example are
229 Generate build targets for the LLVM examples. Defaults to ON. You can use this
230 option to disable the generation of build targets for the LLVM examples.
233 Build LLVM unit tests. Defaults to OFF. Targets for building each unit test
234 are generated in any case. You can build a specific unit test using the
237 for a complete list of unit tests.) It is possible to build all unit tests
241 Generate build targets for the LLVM unit tests. Defaults to ON. You can use
242 this option to disable the generation of build targets for the LLVM unit
248 cmake must be invoked before the build. Defaults to OFF.
251 Build with threads support, if available. Defaults to ON.
254 Build in C++1y mode, if available. Defaults to OFF.
261 Build LLVM with exception-handling support. This is necessary if you wish to
266 Add the ``-fPIC`` flag to the compiler command-line, if the compiler supports
270 Build LLVM with run-time type information. Defaults to OFF.
276 Enable pedantic mode. This disables compiler-specific extensions, if
280 Stop and fail the build, if a compiler warning is triggered. Defaults to OFF.
286 assertion enabled build. `FORCE_ON` (`FORCE_OFF`) turns them on
287 (off) irrespective of whether normal (`NDEBUG`-based) assertions are
292 Build 32-bit executables and libraries on 64-bit systems. This option is
293 available only on some 64-bit Unix systems. Defaults to OFF.
298 of the machine where LLVM is being built. If you are cross-compiling, set it
302 Full path to a native TableGen executable (usually named ``llvm-tblgen``). This is
303 intended for cross-compiling: if the user sets this variable, no native
307 Arguments given to lit. ``make check`` and ``make clang-test`` are affected.
308 By default, ``'-sv --no-progress-bar'`` on Visual C++ and Xcode, ``'-sv'`` on
328 LLVM projects Clang, lld, and Polly, respectively, relative to the top-level
329 source directory. If the in-tree subdirectory for an external project
338 Path to a profdata file to pass into clang's -fprofile-instr-use flag. This
349 Define the sanitizer used to build LLVM binaries and tests. Possible values
361 be built as part of the normal build. If the ``install`` target is run then
371 This affects the make target ``doxygen-llvm``. When enabled, apart from
374 This option is only useful in combination with ``-DLLVM_ENABLE_DOXYGEN=ON``;
379 ``-DLLVM_ENABLE_DOXYGEN=ON`` and
380 ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON`` are given. Defaults to
383 ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``;
390 combination with ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``; otherwise
399 useful in combination with ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``;
402 .. _Qt Help Project: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-filters
407 ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``; otherwise it has no
415 If enabled CMake will search for the ``sphinx-build`` executable and will make
420 The path to the ``sphinx-build`` executable detected by CMake.
426 source tree that uses sphinx (e.g. ``docs-llvm-html``, ``docs-clang-html``
427 and ``docs-lld-html``). Defaults to ON.
432 is enabled). Currently the only target added is ``docs-llvm-man``. Defaults
441 'install-xcode-toolchain'. This target will create a directory at
448 Testing is performed when the *check-all* target is built. For instance, if you are
449 using Makefiles, execute this command in the root of your build directory:
451 .. code-block:: console
453 $ make check-all
455 On Visual Studio, you may run tests by building the project "check-all".
462 generic instructions on how to cross-compile with CMake. It goes into detailed
468 Also see the `LLVM-specific variables`_ section for variables used when
469 cross-compiling.
474 From LLVM 3.5 onwards both the CMake and autoconf/Makefile build systems export
476 now reliably use CMake to develop their own LLVM-based projects against an
480 and uses them to build a simple application ``simple-tool``.
482 .. code-block:: cmake
500 # Now build our tools
501 add_executable(simple-tool tool.cpp)
508 target_link_libraries(simple-tool ${llvm_libs})
514 directory (e.g. by passing ``-DLLVM_DIR=/usr/share/llvm/cmake`` to
515 the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``).
524 ``<LLVM_BUILD_ROOT>`` is the root of the LLVM build tree. **Note: this is only
530 or you wish to build directly against the LLVM build tree you can use
562 The path to the directory containing the LLVM tools (e.g. ``llvm-as``).
564 Notice that in the above example we link ``simple-tool`` against several LLVM
567 components look at the output of running ``llvm-config --components``.
573 .. _cmake-out-of-source-pass:
576 ------------------------------------
581 .. code-block:: none
594 .. code-block:: cmake
605 .. code-block:: cmake
617 .. code-block:: cmake
624 .. code-block:: cmake
633 #. Copying ``<pass name>`` folder into ``<LLVM root>/lib/Transform`` directory.
636 ``<LLVM root>/lib/Transform/CMakeLists.txt``.
638 Compiler/Platform-specific topics
644 --------------------