comparison docs/CMake.rst @ 83:60c9769439b8

LLVM 3.7
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Wed, 18 Feb 2015 14:55:36 +0900
parents 54457678186b
children afa8332a0e37
comparison
equal deleted inserted replaced
78:af83660cff7b 83:60c9769439b8
24 =========== 24 ===========
25 25
26 We use here the command-line, non-interactive CMake interface. 26 We use here the command-line, non-interactive CMake interface.
27 27
28 #. `Download <http://www.cmake.org/cmake/resources/software.html>`_ and install 28 #. `Download <http://www.cmake.org/cmake/resources/software.html>`_ and install
29 CMake. Version 2.8 is the minimum required. 29 CMake. Version 2.8.8 is the minimum required.
30 30
31 #. Open a shell. Your development tools must be reachable from this shell 31 #. Open a shell. Your development tools must be reachable from this shell
32 through the PATH environment variable. 32 through the PATH environment variable.
33 33
34 #. Create a directory for containing the build. It is not supported to build 34 #. Create a directory for containing the build. It is not supported to build
57 itself is the correct one for you development environment. CMake will refuse 57 itself is the correct one for you development environment. CMake will refuse
58 to build MinGW makefiles if you have a POSIX shell reachable through the PATH 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 59 environment variable, for instance. You can force CMake to use a given build
60 tool, see the `Usage`_ section. 60 tool, see the `Usage`_ section.
61 61
62 #. After CMake has finished running, proceed to use IDE project files or start
63 the build from the build directory:
64
65 .. code-block:: console
66
67 $ cmake --build .
68
69 The ``--build`` option tells ``cmake`` to invoke the underlying build
70 tool (``make``, ``ninja``, ``xcodebuild``, ``msbuild``, etc).
71
72 The underlying build tool can be invoked directly either of course, but
73 the ``--build`` option is portable.
74
75 #. After LLVM has finished building, install it from the build directory:
76
77 .. code-block:: console
78
79 $ cmake --build . --target install
80
81 The ``--target`` option with ``install`` parameter in addition to
82 the ``--build`` option tells ``cmake`` to build the ``install`` target.
83
84 It is possible to set a different install prefix at installation time
85 by invoking the ``cmake_install.cmake`` script generated in the
86 build directory:
87
88 .. code-block:: console
89
90 $ cmake -DCMAKE_INSTALL_PREFIX=/tmp/llvm -P cmake_install.cmake
91
62 .. _Basic CMake usage: 92 .. _Basic CMake usage:
63 .. _Usage: 93 .. _Usage:
64 94
65 Basic CMake usage 95 Basic CMake usage
66 ================= 96 =================
213 243
214 **LLVM_ENABLE_CXX1Y**:BOOL 244 **LLVM_ENABLE_CXX1Y**:BOOL
215 Build in C++1y mode, if available. Defaults to OFF. 245 Build in C++1y mode, if available. Defaults to OFF.
216 246
217 **LLVM_ENABLE_ASSERTIONS**:BOOL 247 **LLVM_ENABLE_ASSERTIONS**:BOOL
218 Enables code assertions. Defaults to OFF if and only if ``CMAKE_BUILD_TYPE`` 248 Enables code assertions. Defaults to ON if and only if ``CMAKE_BUILD_TYPE``
219 is *Release*. 249 is *Debug*.
220 250
221 **LLVM_ENABLE_EH**:BOOL 251 **LLVM_ENABLE_EH**:BOOL
222 Build LLVM with exception handling support. This is necessary if you wish to 252 Build LLVM with exception handling support. This is necessary if you wish to
223 link against LLVM libraries and make use of C++ exceptions in your own code 253 link against LLVM libraries and make use of C++ exceptions in your own code
224 that need to propagate through LLVM code. Defaults to OFF. 254 that need to propagate through LLVM code. Defaults to OFF.
232 262
233 **LLVM_ENABLE_WARNINGS**:BOOL 263 **LLVM_ENABLE_WARNINGS**:BOOL
234 Enable all compiler warnings. Defaults to ON. 264 Enable all compiler warnings. Defaults to ON.
235 265
236 **LLVM_ENABLE_PEDANTIC**:BOOL 266 **LLVM_ENABLE_PEDANTIC**:BOOL
237 Enable pedantic mode. This disable compiler specific extensions, is 267 Enable pedantic mode. This disables compiler specific extensions, if
238 possible. Defaults to ON. 268 possible. Defaults to ON.
239 269
240 **LLVM_ENABLE_WERROR**:BOOL 270 **LLVM_ENABLE_WERROR**:BOOL
241 Stop and fail build, if a compiler warning is triggered. Defaults to OFF. 271 Stop and fail build, if a compiler warning is triggered. Defaults to OFF.
242 272
288 318
289 **LLVM_USE_SANITIZER**:STRING 319 **LLVM_USE_SANITIZER**:STRING
290 Define the sanitizer used to build LLVM binaries and tests. Possible values 320 Define the sanitizer used to build LLVM binaries and tests. Possible values
291 are ``Address``, ``Memory``, ``MemoryWithOrigins`` and ``Undefined``. 321 are ``Address``, ``Memory``, ``MemoryWithOrigins`` and ``Undefined``.
292 Defaults to empty string. 322 Defaults to empty string.
323
324 **LLVM_PARALLEL_COMPILE_JOBS**:STRING
325 Define the maximum number of concurrent compilation jobs.
326
327 **LLVM_PARALLEL_LINK_JOBS**:STRING
328 Define the maximum number of concurrent link jobs.
293 329
294 **LLVM_BUILD_DOCS**:BOOL 330 **LLVM_BUILD_DOCS**:BOOL
295 Enables all enabled documentation targets (i.e. Doxgyen and Sphinx targets) to 331 Enables all enabled documentation targets (i.e. Doxgyen and Sphinx targets) to
296 be built as part of the normal build. If the ``install`` target is run then 332 be built as part of the normal build. If the ``install`` target is run then
297 this also enables all built documentation targets to be installed. Defaults to 333 this also enables all built documentation targets to be installed. Defaults to
308 named ``org.llvm.qch``. You can then load this file into Qt Creator. 344 named ``org.llvm.qch``. You can then load this file into Qt Creator.
309 This option is only useful in combination with ``-DLLVM_ENABLE_DOXYGEN=ON``; 345 This option is only useful in combination with ``-DLLVM_ENABLE_DOXYGEN=ON``;
310 otherwise this has no effect. 346 otherwise this has no effect.
311 347
312 **LLVM_DOXYGEN_QCH_FILENAME**:STRING 348 **LLVM_DOXYGEN_QCH_FILENAME**:STRING
313 The filename of the Qt Compressed Help file that will be genrated when 349 The filename of the Qt Compressed Help file that will be generated when
314 ``-DLLVM_ENABLE_DOXYGEN=ON`` and 350 ``-DLLVM_ENABLE_DOXYGEN=ON`` and
315 ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON`` are given. Defaults to 351 ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON`` are given. Defaults to
316 ``org.llvm.qch``. 352 ``org.llvm.qch``.
317 This option is only useful in combination with 353 This option is only useful in combination with
318 ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``; 354 ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``;
319 otherwise this has no effect. 355 otherwise this has no effect.
322 Namespace under which the intermediate Qt Help Project file lives. See `Qt 358 Namespace under which the intermediate Qt Help Project file lives. See `Qt
323 Help Project`_ 359 Help Project`_
324 for more information. Defaults to "org.llvm". This option is only useful in 360 for more information. Defaults to "org.llvm". This option is only useful in
325 combination with ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``; otherwise 361 combination with ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``; otherwise
326 this has no effect. 362 this has no effect.
327 363
328 **LLVM_DOXYGEN_QHP_CUST_FILTER_NAME**:STRING 364 **LLVM_DOXYGEN_QHP_CUST_FILTER_NAME**:STRING
329 See `Qt Help Project`_ for 365 See `Qt Help Project`_ for
330 more information. Defaults to the CMake variable ``${PACKAGE_STRING}`` which 366 more information. Defaults to the CMake variable ``${PACKAGE_STRING}`` which
331 is a combination of the package name and version string. This filter can then 367 is a combination of the package name and version string. This filter can then
332 be used in Qt Creator to select only documentation from LLVM when browsing 368 be used in Qt Creator to select only documentation from LLVM when browsing
421 457
422 include_directories(${LLVM_INCLUDE_DIRS}) 458 include_directories(${LLVM_INCLUDE_DIRS})
423 add_definitions(${LLVM_DEFINITIONS}) 459 add_definitions(${LLVM_DEFINITIONS})
424 460
425 # Now build our tools 461 # Now build our tools
426 add_excutable(simple-tool tool.cpp) 462 add_executable(simple-tool tool.cpp)
427 463
428 # Find the libraries that correspond to the LLVM components 464 # Find the libraries that correspond to the LLVM components
429 # that we wish to use 465 # that we wish to use
430 llvm_map_components_to_libnames(llvm_libs support core irreader) 466 llvm_map_components_to_libnames(llvm_libs support core irreader)
431 467