Skip to content

Commit f6357bb

Browse files
authored
[llvm][docs] Resort cmake macros (#87551)
The cmake macro documentation had once again become unsorted. For names of the form 'PREFIX_{list-or-category}_SUFFIX' I collate as 'PREFIX_SUFFIX'.
1 parent 4308c74 commit f6357bb

File tree

1 file changed

+68
-69
lines changed

1 file changed

+68
-69
lines changed

llvm/docs/CMake.rst

Lines changed: 68 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,14 @@ manual, or execute ``cmake --help-variable VARIABLE_NAME``.
283283
The path to install executables, relative to the *CMAKE_INSTALL_PREFIX*.
284284
Defaults to "bin".
285285

286-
**CMAKE_INSTALL_INCLUDEDIR**:PATH
287-
The path to install header files, relative to the *CMAKE_INSTALL_PREFIX*.
288-
Defaults to "include".
289-
290286
**CMAKE_INSTALL_DOCDIR**:PATH
291287
The path to install documentation, relative to the *CMAKE_INSTALL_PREFIX*.
292288
Defaults to "share/doc".
293289

290+
**CMAKE_INSTALL_INCLUDEDIR**:PATH
291+
The path to install header files, relative to the *CMAKE_INSTALL_PREFIX*.
292+
Defaults to "include".
293+
294294
**CMAKE_INSTALL_MANDIR**:PATH
295295
The path to install manpage files, relative to the *CMAKE_INSTALL_PREFIX*.
296296
Defaults to "share/man".
@@ -328,28 +328,22 @@ enabled sub-projects. Nearly all of these variable names begin with
328328
allows for them to be specified as values in CMAKE_BUILD_TYPE without
329329
encountering a fatal error during the configuration process.
330330

331-
**LLVM_UNREACHABLE_OPTIMIZE**:BOOL
332-
This flag controls the behavior of `llvm_unreachable()` in release build
333-
(when assertions are disabled in general). When ON (default) then
334-
`llvm_unreachable()` is considered "undefined behavior" and optimized as
335-
such. When OFF it is instead replaced with a guaranteed "trap".
336-
337331
**LLVM_APPEND_VC_REV**:BOOL
338332
Embed version control revision info (Git revision id).
339333
The version info is provided by the ``LLVM_REVISION`` macro in
340334
``llvm/include/llvm/Support/VCSRevision.h``. Developers using git who don't
341335
need revision info can disable this option to avoid re-linking most binaries
342336
after a branch switch. Defaults to ON.
343337

338+
**LLVM_FORCE_VC_REPOSITORY**:STRING
339+
Set the git repository to include in version info rather than calling git to
340+
determine it.
341+
344342
**LLVM_FORCE_VC_REVISION**:STRING
345343
Force a specific Git revision id rather than calling to git to determine it.
346344
This is useful in environments where git is not available or non-functional
347345
but the VC revision is available through other means.
348346

349-
**LLVM_FORCE_VC_REPOSITORY**:STRING
350-
Set the git repository to include in version info rather than calling git to
351-
determine it.
352-
353347
**LLVM_BUILD_32_BITS**:BOOL
354348
Build 32-bit executables and libraries on 64-bit systems. This option is
355349
available only on some 64-bit Unix systems. Defaults to OFF.
@@ -381,22 +375,6 @@ enabled sub-projects. Nearly all of these variable names begin with
381375
*LLVM_CODE_COVERAGE_TARGETS* and *LLVM_COVERAGE_SOURCE_DIRS* for more
382376
information on configuring code coverage reports.
383377

384-
**LLVM_CODE_COVERAGE_TARGETS**:STRING
385-
If set to a semicolon separated list of targets, those targets will be used
386-
to drive the code coverage reports. If unset, the target list will be
387-
constructed using the LLVM build's CMake export list.
388-
389-
**LLVM_COVERAGE_SOURCE_DIRS**:STRING
390-
If set to a semicolon separated list of directories, the coverage reports
391-
will limit code coverage summaries to just the listed directories. If unset,
392-
coverage reports will include all sources identified by the tooling.
393-
394-
**LLVM_INDIVIDUAL_TEST_COVERAGE**:BOOL
395-
Enable individual test case coverage. When set to ON, code coverage data for
396-
each test case will be generated and stored in a separate directory under the
397-
config.test_exec_root path. This feature allows code coverage analysis of each
398-
individual test case. Defaults to OFF.
399-
400378
**LLVM_BUILD_LLVM_DYLIB**:BOOL
401379
If enabled, the target for building the libLLVM shared library is added.
402380
This library contains all of LLVM's components in a single shared library.
@@ -429,15 +407,22 @@ enabled sub-projects. Nearly all of these variable names begin with
429407
options, which are passed to the CCACHE_MAXSIZE and CCACHE_DIR environment
430408
variables, respectively.
431409

410+
**LLVM_CODE_COVERAGE_TARGETS**:STRING
411+
If set to a semicolon separated list of targets, those targets will be used
412+
to drive the code coverage reports. If unset, the target list will be
413+
constructed using the LLVM build's CMake export list.
414+
415+
**LLVM_COVERAGE_SOURCE_DIRS**:STRING
416+
If set to a semicolon separated list of directories, the coverage reports
417+
will limit code coverage summaries to just the listed directories. If unset,
418+
coverage reports will include all sources identified by the tooling.
419+
432420
**LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL
433421
macOS Only: If enabled CMake will generate a target named
434422
'install-xcode-toolchain'. This target will create a directory at
435423
$CMAKE_INSTALL_PREFIX/Toolchains containing an xctoolchain directory which can
436424
be used to override the default system tools.
437425

438-
**LLVM_<target>_LINKER_FLAGS**:STRING
439-
Defines the set of linker flags that should be applied to a <target>.
440-
441426
**LLVM_DEFAULT_TARGET_TRIPLE**:STRING
442427
LLVM target to use for code generation when no target is explicitly specified.
443428
It defaults to "host", meaning that it shall pick the architecture
@@ -514,11 +499,6 @@ enabled sub-projects. Nearly all of these variable names begin with
514499
**LLVM_ENABLE_EXPENSIVE_CHECKS**:BOOL
515500
Enable additional time/memory expensive checking. Defaults to OFF.
516501

517-
**LLVM_ENABLE_HTTPLIB**:BOOL
518-
Enables the optional cpp-httplib dependency which is used by llvm-debuginfod
519-
to serve debug info over HTTP. `cpp-httplib <https://github.com/yhirose/cpp-httplib>`_
520-
must be installed, or `httplib_ROOT` must be set. Defaults to OFF.
521-
522502
**LLVM_ENABLE_FFI**:BOOL
523503
Indicates whether the LLVM Interpreter will be linked with the Foreign Function
524504
Interface library (libffi) in order to enable calling external functions.
@@ -527,6 +507,11 @@ enabled sub-projects. Nearly all of these variable names begin with
527507
FFI_LIBRARY_DIR to the directories where ffi.h and libffi.so can be found,
528508
respectively. Defaults to OFF.
529509

510+
**LLVM_ENABLE_HTTPLIB**:BOOL
511+
Enables the optional cpp-httplib dependency which is used by llvm-debuginfod
512+
to serve debug info over HTTP. `cpp-httplib <https://github.com/yhirose/cpp-httplib>`_
513+
must be installed, or `httplib_ROOT` must be set. Defaults to OFF.
514+
530515
**LLVM_ENABLE_IDE**:BOOL
531516
Tell the build system that an IDE is being used. This in turn disables the
532517
creation of certain convenience build system targets, such as the various
@@ -539,11 +524,6 @@ enabled sub-projects. Nearly all of these variable names begin with
539524
passed to invocations of both so that the project is built using libc++
540525
instead of stdlibc++. Defaults to OFF.
541526

542-
**LLVM_ENABLE_LLVM_LIBC**: BOOL
543-
If the LLVM libc overlay is installed in a location where the host linker
544-
can access it, all built executables will be linked against the LLVM libc
545-
overlay before linking against the system libc. Defaults to OFF.
546-
547527
**LLVM_ENABLE_LIBPFM**:BOOL
548528
Enable building with libpfm to support hardware counter measurements in LLVM
549529
tools.
@@ -554,6 +534,11 @@ enabled sub-projects. Nearly all of these variable names begin with
554534
build where a dependency is added from the first stage to the second ensuring
555535
that lld is built before stage2 begins.
556536

537+
**LLVM_ENABLE_LLVM_LIBC**: BOOL
538+
If the LLVM libc overlay is installed in a location where the host linker
539+
can access it, all built executables will be linked against the LLVM libc
540+
overlay before linking against the system libc. Defaults to OFF.
541+
557542
**LLVM_ENABLE_LTO**:STRING
558543
Add ``-flto`` or ``-flto=`` flags to the compile and link command
559544
lines, enabling link-time optimization. Possible values are ``Off``,
@@ -581,6 +566,9 @@ enabled sub-projects. Nearly all of these variable names begin with
581566
The full list is:
582567
``clang;clang-tools-extra;cross-project-tests;libc;libclc;lld;lldb;openmp;polly;pstl``
583568

569+
**LLVM_ENABLE_RTTI**:BOOL
570+
Build LLVM with run-time type information. Defaults to OFF.
571+
584572
**LLVM_ENABLE_RUNTIMES**:STRING
585573
Build libc++, libc++abi, libunwind or compiler-rt using the just-built compiler.
586574
This is the correct way to build runtimes when putting together a toolchain.
@@ -593,10 +581,6 @@ enabled sub-projects. Nearly all of these variable names begin with
593581
To enable all of them, use:
594582
``LLVM_ENABLE_RUNTIMES=all``
595583

596-
597-
**LLVM_ENABLE_RTTI**:BOOL
598-
Build LLVM with run-time type information. Defaults to OFF.
599-
600584
**LLVM_ENABLE_SPHINX**:BOOL
601585
If specified, CMake will search for the ``sphinx-build`` executable and will make
602586
the ``SPHINX_OUTPUT_HTML`` and ``SPHINX_OUTPUT_MAN`` CMake options available.
@@ -634,14 +618,6 @@ enabled sub-projects. Nearly all of these variable names begin with
634618
llvm. This will build the experimental target without needing it to add to the
635619
list of all the targets available in the LLVM's main CMakeLists.txt.
636620

637-
**LLVM_EXTERNAL_{CLANG,LLD,POLLY}_SOURCE_DIR**:PATH
638-
These variables specify the path to the source directory for the external
639-
LLVM projects Clang, lld, and Polly, respectively, relative to the top-level
640-
source directory. If the in-tree subdirectory for an external project
641-
exists (e.g., llvm/tools/clang for Clang), then the corresponding variable
642-
will not be used. If the variable for an external project does not point
643-
to a valid path, then that project will not be built.
644-
645621
**LLVM_EXTERNAL_PROJECTS**:STRING
646622
Semicolon-separated list of additional external projects to build as part of
647623
llvm. For each project LLVM_EXTERNAL_<NAME>_SOURCE_DIR have to be specified
@@ -650,6 +626,14 @@ enabled sub-projects. Nearly all of these variable names begin with
650626
-DLLVM_EXTERNAL_FOO_SOURCE_DIR=/src/foo
651627
-DLLVM_EXTERNAL_BAR_SOURCE_DIR=/src/bar``.
652628

629+
**LLVM_EXTERNAL_{CLANG,LLD,POLLY}_SOURCE_DIR**:PATH
630+
These variables specify the path to the source directory for the external
631+
LLVM projects Clang, lld, and Polly, respectively, relative to the top-level
632+
source directory. If the in-tree subdirectory for an external project
633+
exists (e.g., llvm/tools/clang for Clang), then the corresponding variable
634+
will not be used. If the variable for an external project does not point
635+
to a valid path, then that project will not be built.
636+
653637
**LLVM_EXTERNALIZE_DEBUGINFO**:BOOL
654638
Generate dSYM files and strip executables and libraries (Darwin Only).
655639
Defaults to OFF.
@@ -680,6 +664,12 @@ enabled sub-projects. Nearly all of these variable names begin with
680664
Generate build targets for the LLVM tools. Defaults to ON. You can use this
681665
option to disable the generation of build targets for the LLVM tools.
682666

667+
**LLVM_INDIVIDUAL_TEST_COVERAGE**:BOOL
668+
Enable individual test case coverage. When set to ON, code coverage data for
669+
each test case will be generated and stored in a separate directory under the
670+
config.test_exec_root path. This feature allows code coverage analysis of each
671+
individual test case. Defaults to OFF.
672+
683673
**LLVM_INSTALL_BINUTILS_SYMLINKS**:BOOL
684674
Install symlinks from the binutils tool names to the corresponding LLVM tools.
685675
For example, ar will be symlinked to llvm-ar.
@@ -702,6 +692,11 @@ enabled sub-projects. Nearly all of these variable names begin with
702692
If enabled, utility binaries like ``FileCheck`` and ``not`` will be installed
703693
to CMAKE_INSTALL_PREFIX.
704694

695+
**LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING
696+
The path to install Doxygen-generated HTML documentation to. This path can
697+
either be absolute or relative to the *CMAKE_INSTALL_PREFIX*. Defaults to
698+
``${CMAKE_INSTALL_DOCDIR}/llvm/doxygen-html``.
699+
705700
**LLVM_INTEGRATED_CRT_ALLOC**:PATH
706701
On Windows, allows embedding a different C runtime allocator into the LLVM
707702
tools and libraries. Using a lock-free allocator such as the ones listed below
@@ -718,17 +713,15 @@ enabled sub-projects. Nearly all of these variable names begin with
718713
This flag needs to be used along with the static CRT, ie. if building the
719714
Release target, add -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded.
720715

721-
**LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING
722-
The path to install Doxygen-generated HTML documentation to. This path can
723-
either be absolute or relative to the *CMAKE_INSTALL_PREFIX*. Defaults to
724-
``${CMAKE_INSTALL_DOCDIR}/llvm/doxygen-html``.
725-
726716
**LLVM_LINK_LLVM_DYLIB**:BOOL
727717
If enabled, tools will be linked with the libLLVM shared library. Defaults
728718
to OFF. Setting LLVM_LINK_LLVM_DYLIB to ON also sets LLVM_BUILD_LLVM_DYLIB
729719
to ON.
730720
This option is not available on Windows.
731721

722+
**LLVM_<target>_LINKER_FLAGS**:STRING
723+
Defines the set of linker flags that should be applied to a <target>.
724+
732725
**LLVM_LIT_ARGS**:STRING
733726
Arguments given to lit. ``make check`` and ``make clang-test`` are affected.
734727
By default, ``'-sv --no-progress-bar'`` on Visual C++ and Xcode, ``'-sv'`` on
@@ -770,6 +763,10 @@ enabled sub-projects. Nearly all of these variable names begin with
770763
**LLVM_PARALLEL_TABLEGEN_JOBS**:STRING
771764
Define the maximum number of concurrent tablegen jobs.
772765

766+
**LLVM_PROFDATA_FILE**:PATH
767+
Path to a profdata file to pass into clang's -fprofile-instr-use flag. This
768+
can only be specified if you're building with clang.
769+
773770
**LLVM_RAM_PER_COMPILE_JOB**:STRING
774771
Calculates the amount of Ninja compile jobs according to available resources.
775772
Value has to be in MB, overwrites LLVM_PARALLEL_COMPILE_JOBS. Compile jobs
@@ -788,10 +785,6 @@ enabled sub-projects. Nearly all of these variable names begin with
788785
Value has to be in MB, overwrites LLVM_PARALLEL_TABLEGEN_JOBS. Tablegen jobs
789786
will be between one and amount of logical cores.
790787

791-
**LLVM_PROFDATA_FILE**:PATH
792-
Path to a profdata file to pass into clang's -fprofile-instr-use flag. This
793-
can only be specified if you're building with clang.
794-
795788
**LLVM_REVERSE_ITERATION**:BOOL
796789
If enabled, all supported unordered llvm containers would be iterated in
797790
reverse order. This is useful for uncovering non-determinism caused by
@@ -829,6 +822,12 @@ enabled sub-projects. Nearly all of these variable names begin with
829822
``LLVM_USE_SANITIZER`` contains ``Undefined``. This can be used to override
830823
the default set of UBSan flags.
831824

825+
**LLVM_UNREACHABLE_OPTIMIZE**:BOOL
826+
This flag controls the behavior of `llvm_unreachable()` in release build
827+
(when assertions are disabled in general). When ON (default) then
828+
`llvm_unreachable()` is considered "undefined behavior" and optimized as
829+
such. When OFF it is instead replaced with a guaranteed "trap".
830+
832831
**LLVM_USE_INTEL_JITEVENTS**:BOOL
833832
Enable building support for Intel JIT Events API. Defaults to OFF.
834833

@@ -892,6 +891,11 @@ Advanced variables
892891
These are niche, and changing them from their defaults is more likely to cause
893892
things to go wrong. They are also unstable across LLVM versions.
894893

894+
**LLVM_EXAMPLES_INSTALL_DIR**:STRING
895+
The path for examples of using LLVM, relative to the *CMAKE_INSTALL_PREFIX*.
896+
Only matters if *LLVM_BUILD_EXAMPLES* is enabled.
897+
Defaults to "examples".
898+
895899
**LLVM_TOOLS_INSTALL_DIR**:STRING
896900
The path to install the main LLVM tools, relative to the *CMAKE_INSTALL_PREFIX*.
897901
Defaults to *CMAKE_INSTALL_BINDIR*.
@@ -901,11 +905,6 @@ things to go wrong. They are also unstable across LLVM versions.
901905
Only matters if *LLVM_INSTALL_UTILS* is enabled.
902906
Defaults to *LLVM_TOOLS_INSTALL_DIR*.
903907

904-
**LLVM_EXAMPLES_INSTALL_DIR**:STRING
905-
The path for examples of using LLVM, relative to the *CMAKE_INSTALL_PREFIX*.
906-
Only matters if *LLVM_BUILD_EXAMPLES* is enabled.
907-
Defaults to "examples".
908-
909908
CMake Caches
910909
============
911910

0 commit comments

Comments
 (0)