Skip to content

Commit 100180f

Browse files
[llvm] Proofread CMake.rst (llvm#156276)
1 parent bed3c7e commit 100180f

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

llvm/docs/CMake.rst

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ We use here the command-line, non-interactive CMake interface.
4040
through the ``PATH`` environment variable.
4141

4242
#. Create a build directory. Building LLVM in the source
43-
directory is not supported. cd to this directory:
43+
directory is not supported. ``cd`` to this directory:
4444

4545
.. code-block:: console
4646
@@ -108,7 +108,7 @@ Basic CMake usage
108108

109109
This section explains basic aspects of CMake for daily use.
110110

111-
CMake comes with extensive documentation, in the form of html files, and as
111+
CMake comes with extensive documentation, in the form of HTML files, and as
112112
online help accessible via the ``cmake`` executable itself. Execute ``cmake
113113
--help`` for further help options.
114114

@@ -139,7 +139,7 @@ A given development platform can have more than one adequate
139139
generator. If you use Visual Studio, "NMake Makefiles" is a generator you can use
140140
for building with NMake. By default, CMake chooses the most specific generator
141141
supported by your development environment. If you want an alternative generator,
142-
you must tell this to CMake with the ``-G`` option.
142+
you must specify this to CMake with the ``-G`` option.
143143

144144
.. todo::
145145

@@ -206,7 +206,7 @@ used variables that control features of LLVM and enabled subprojects.
206206

207207
* Optimizations make LLVM/Clang run faster but can be an impediment for
208208
step-by-step debugging.
209-
* Builds with debug information can use a lot of RAM and disk space and is
209+
* Builds with debug information can use a lot of RAM and disk space and are
210210
usually slower to run. You can improve RAM usage by using ``lld``, see
211211
the :ref:`LLVM_USE_LINKER <llvm_use_linker>` option.
212212
* Assertions are internal checks to help you find bugs. They typically slow
@@ -257,10 +257,10 @@ description is in `LLVM-related variables`_ below.
257257

258258
**LLVM_PARALLEL_{COMPILE,LINK}_JOBS**:STRING
259259
Building the llvm toolchain can use a lot of resources, particularly
260-
linking. These options, when you use the Ninja generator, allow you
260+
during linking. These options, when you use the Ninja generator, allow you
261261
to restrict the parallelism. For example, to avoid OOMs or going
262-
into swap, permit only one link job per 15GB of RAM available on a
263-
32GB machine, specify ``-G Ninja -DLLVM_PARALLEL_LINK_JOBS=2``.
262+
into swap, permit only one link job per 15 GB of RAM available on a
263+
32 GB machine, specify ``-G Ninja -DLLVM_PARALLEL_LINK_JOBS=2``.
264264

265265
**LLVM_TARGETS_TO_BUILD**:STRING
266266
Control which targets are enabled. For example, you may only need to enable
@@ -324,13 +324,13 @@ its enabled sub-projects. Nearly all of these variable names begin with
324324
Used to decide if LLVM should be built with ABI breaking checks or
325325
not. Allowed values are `WITH_ASSERTS` (default), `FORCE_ON` and
326326
`FORCE_OFF`. `WITH_ASSERTS` turns on ABI breaking checks in an
327-
assertion enabled build. `FORCE_ON` (`FORCE_OFF`) turns them on
327+
assertion-enabled build. `FORCE_ON` (`FORCE_OFF`) turns them on
328328
(off) irrespective of whether normal (`NDEBUG`-based) assertions are
329329
enabled or not. A version of LLVM built with ABI breaking checks
330330
is not ABI compatible with a version built without it.
331331

332332
**LLVM_ADDITIONAL_BUILD_TYPES**:LIST
333-
Adding a semicolon separated list of additional build types to this flag
333+
Adding a semicolon-separated list of additional build types to this flag
334334
allows for them to be specified as values in ``CMAKE_BUILD_TYPE`` without
335335
encountering a fatal error during the configuration process.
336336

@@ -346,7 +346,7 @@ its enabled sub-projects. Nearly all of these variable names begin with
346346
determine it.
347347

348348
**LLVM_FORCE_VC_REVISION**:STRING
349-
Force a specific Git revision id rather than calling to git to determine it.
349+
Force a specific Git revision id rather than calling git to determine it.
350350
This is useful in environments where git is not available or non-functional
351351
but the VC revision is available through other means.
352352

@@ -358,9 +358,9 @@ its enabled sub-projects. Nearly all of these variable names begin with
358358
Adds benchmarks to the list of default targets. Defaults to OFF.
359359

360360
**LLVM_BUILD_DOCS**:BOOL
361-
Adds all *enabled* documentation targets (i.e. Doxygen and Sphinx targets) as
361+
Adds all *enabled* documentation targets (i.e., Doxygen and Sphinx targets) as
362362
dependencies of the default build targets. This results in all of the (enabled)
363-
documentation targets being as part of a normal build. If the ``install``
363+
documentation targets being built as part of a normal build. If the ``install``
364364
target is run, then this also enables all built documentation targets to be
365365
installed. Defaults to OFF. To enable a particular documentation target, see
366366
``LLVM_ENABLE_SPHINX`` and ``LLVM_ENABLE_DOXYGEN``.
@@ -414,17 +414,17 @@ its enabled sub-projects. Nearly all of these variable names begin with
414414
variables, respectively.
415415

416416
**LLVM_CODE_COVERAGE_TARGETS**:STRING
417-
If set to a semicolon separated list of targets, those targets will be used
417+
If set to a semicolon-separated list of targets, those targets will be used
418418
to drive the code coverage reports. If unset, the target list will be
419419
constructed using the LLVM build's CMake export list.
420420

421421
**LLVM_COVERAGE_SOURCE_DIRS**:STRING
422-
If set to a semicolon separated list of directories, the coverage reports
422+
If set to a semicolon-separated list of directories, the coverage reports
423423
will limit code coverage summaries to just the listed directories. If unset,
424424
coverage reports will include all sources identified by the tooling.
425425

426426
**LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL
427-
macOS Only: If enabled, CMake will generate a target named
427+
macOS only: If enabled, CMake will generate a target named
428428
'install-xcode-toolchain'. This target will create a directory at
429429
``$CMAKE_INSTALL_PREFIX/Toolchains`` containing an xctoolchain directory which can
430430
be used to override the default system tools.
@@ -588,8 +588,8 @@ its enabled sub-projects. Nearly all of these variable names begin with
588588
Semicolon-separated list of projects to build, or *all* for building all
589589
(clang, lldb, lld, polly, etc) projects. This flag assumes that projects
590590
are checked out side-by-side and not nested, i.e. clang needs to be in
591-
parallel of llvm instead of nested in ``llvm/tools``. This feature allows
592-
to have one build for only LLVM and another for clang+llvm using the same
591+
parallel to llvm instead of nested in ``llvm/tools``. This feature allows
592+
having one build for only LLVM and another for clang+llvm using the same
593593
source checkout.
594594

595595
The full list is:
@@ -657,11 +657,11 @@ its enabled sub-projects. Nearly all of these variable names begin with
657657
**LLVM_EXPERIMENTAL_TARGETS_TO_BUILD**:STRING
658658
Semicolon-separated list of experimental targets to build and linked into
659659
llvm. This will build the experimental target without needing it to add to the
660-
list of all the targets available in the LLVM's main CMakeLists.txt.
660+
list of all the targets available in the LLVM's main ``CMakeLists.txt``.
661661

662662
**LLVM_EXTERNAL_PROJECTS**:STRING
663663
Semicolon-separated list of additional external projects to build as part of
664-
llvm. For each project LLVM_EXTERNAL_<NAME>_SOURCE_DIR have to be specified
664+
llvm. For each project, ``LLVM_EXTERNAL_<NAME>_SOURCE_DIR`` has to be specified
665665
with the path for the source code of the project. Example:
666666
``-DLLVM_EXTERNAL_PROJECTS="Foo;Bar"
667667
-DLLVM_EXTERNAL_FOO_SOURCE_DIR=/src/foo
@@ -676,7 +676,7 @@ its enabled sub-projects. Nearly all of these variable names begin with
676676
to a valid path, then that project will not be built.
677677

678678
**LLVM_EXTERNALIZE_DEBUGINFO**:BOOL
679-
Generate dSYM files and strip executables and libraries (Darwin Only).
679+
Generate dSYM files and strip executables and libraries (Darwin only).
680680
Defaults to OFF.
681681

682682
**LLVM_ENABLE_EXPORTED_SYMBOLS_IN_EXECUTABLES**:BOOL
@@ -751,7 +751,7 @@ its enabled sub-projects. Nearly all of these variable names begin with
751751
$ D:\git> git clone https://github.com/mjansson/rpmalloc
752752
$ D:\llvm-project> cmake ... -DLLVM_INTEGRATED_CRT_ALLOC=D:\git\rpmalloc
753753
754-
This option needs to be used along with the static CRT, ie. if building the
754+
This option needs to be used along with the static CRT, i.e., if building the
755755
Release target, add ``-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded``.
756756
Note that rpmalloc is also supported natively in-tree, see option below.
757757

@@ -778,7 +778,7 @@ its enabled sub-projects. Nearly all of these variable names begin with
778778
**LLVM_LIT_TOOLS_DIR**:PATH
779779
The path to GnuWin32 tools for tests. Valid on Windows host. Defaults to
780780
the empty string, in which case lit will look for tools needed for tests
781-
(e.g. ``grep``, ``sort``, etc.) in your ``%PATH%``. If GnuWin32 is not in your
781+
(e.g., ``grep``, ``sort``, etc.) in your ``%PATH%``. If GnuWin32 is not in your
782782
``%PATH%``, then you can set this variable to the GnuWin32 directory so that
783783
lit can find tools needed for tests in that directory.
784784

@@ -797,7 +797,7 @@ its enabled sub-projects. Nearly all of these variable names begin with
797797
set to non-standard values.
798798

799799
**LLVM_OPTIMIZED_TABLEGEN**:BOOL
800-
If enabled and building a debug or asserts build, the CMake build system will
800+
If enabled and building a debug or assert build, the CMake build system will
801801
generate a Release build tree to build a fully optimized tablegen for use
802802
during the build. Enabling this option can significantly speed up build times,
803803
especially when building LLVM in Debug configurations.
@@ -818,7 +818,7 @@ its enabled sub-projects. Nearly all of these variable names begin with
818818
``LLVM_PARALLEL_{COMPILE,LINK,TABLEGEN}_JOBS`` variable is
819819
overwritten by computing the memory size divided by the
820820
specified value. The largest memory user is linking, but remember
821-
that jobs in the other categories might run in parallel to the link
821+
that jobs in the other categories might run in parallel with the link
822822
jobs, and you need to consider their memory requirements when
823823
in a memory-limited environment. Using a
824824
``-DLLVM_RAM_PER_LINK_JOB=10000`` is a good approximation. On ELF
@@ -869,7 +869,7 @@ its enabled sub-projects. Nearly all of these variable names begin with
869869
the default set of UBSan flags.
870870

871871
**LLVM_UNREACHABLE_OPTIMIZE**:BOOL
872-
This flag controls the behavior of ``llvm_unreachable()`` in release build
872+
This flag controls the behavior of ``llvm_unreachable()`` in a release build
873873
(when assertions are disabled in general). When ON (default) then
874874
``llvm_unreachable()`` is considered "undefined behavior" and optimized as
875875
such. When OFF it is instead replaced with a guaranteed "trap".
@@ -879,9 +879,9 @@ its enabled sub-projects. Nearly all of these variable names begin with
879879

880880
**LLVM_USE_LINKER**:STRING
881881
Add ``-fuse-ld={name}`` to the link invocation. The possible values depend on
882-
your compiler, for clang the value can be an absolute path to your custom
882+
your compiler. For clang, the value can be an absolute path to your custom
883883
linker, otherwise clang will prefix the name with ``ld.`` and apply its usual
884-
search. For example to link LLVM with the Gold linker, cmake can be invoked
884+
search. For example, to link LLVM with the Gold linker, cmake can be invoked
885885
with ``-DLLVM_USE_LINKER=gold``.
886886

887887
**LLVM_USE_OPROFILE**:BOOL
@@ -892,11 +892,11 @@ its enabled sub-projects. Nearly all of these variable names begin with
892892

893893
**LLVM_USE_RELATIVE_PATHS_IN_FILES**:BOOL
894894
Rewrite absolute source paths in sources and debug info to relative ones. The
895-
source prefix can be adjusted via the LLVM_SOURCE_PREFIX variable.
895+
source prefix can be adjusted via the ``LLVM_SOURCE_PREFIX`` variable.
896896

897897
**LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO**:BOOL
898898
Rewrite absolute source paths in debug info to relative ones. The source prefix
899-
can be adjusted via the LLVM_SOURCE_PREFIX variable.
899+
can be adjusted via the ``LLVM_SOURCE_PREFIX`` variable.
900900

901901
**LLVM_USE_SANITIZER**:STRING
902902
Define the sanitizer used to build LLVM binaries and tests. Possible values
@@ -916,9 +916,9 @@ its enabled sub-projects. Nearly all of these variable names begin with
916916

917917
**SPHINX_OUTPUT_HTML**:BOOL
918918
If enabled (and ``LLVM_ENABLE_SPHINX`` is enabled) then the targets for
919-
building the documentation as html are added (but not built by default unless
919+
building the documentation as HTML are added (but not built by default unless
920920
``LLVM_BUILD_DOCS`` is enabled). There is a target for each project in the
921-
source tree that uses sphinx (e.g. ``docs-llvm-html``, ``docs-clang-html``
921+
source tree that uses sphinx (e.g., ``docs-llvm-html``, ``docs-clang-html``
922922
and ``docs-lld-html``). Defaults to ON.
923923

924924
**SPHINX_OUTPUT_MAN**:BOOL
@@ -973,15 +973,15 @@ A few notes about CMake Caches:
973973

974974
- Order of command line arguments is important
975975

976-
- ``-D`` arguments specified before -C are set before the cache is processed and
976+
- ``-D`` arguments specified before ``-C`` are set before the cache is processed and
977977
can be read inside the cache file
978-
- ``-D`` arguments specified after -C are set after the cache is processed and
978+
- ``-D`` arguments specified after ``-C`` are set after the cache is processed and
979979
are unset inside the cache file
980980

981981
- All ``-D`` arguments will override cache file settings
982982
- CMAKE_TOOLCHAIN_FILE is evaluated after both the cache file and the command
983983
line arguments
984-
- It is recommended that all ``-D`` options should be specified *before* -C
984+
- It is recommended that all ``-D`` options be specified *before* ``-C``
985985

986986
For more information about some of the advanced build configurations supported
987987
via Cache files see :doc:`AdvancedBuilds`.
@@ -1004,7 +1004,7 @@ Cross compiling
10041004

10051005
See `this wiki page <https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/CrossCompiling>`_ for
10061006
generic instructions on how to cross-compile with CMake. It goes into detailed
1007-
explanations and may seem daunting, but it is not. On the wiki page there are
1007+
explanations and may seem daunting, but it is not. The wiki page has
10081008
several examples including toolchain files. Go directly to the
10091009
``Information how to set up various cross compiling toolchains`` section
10101010
for a quick solution.
@@ -1015,12 +1015,12 @@ cross-compiling.
10151015
Embedding LLVM in your project
10161016
==============================
10171017

1018-
From LLVM 3.5 onwards the CMake build system exports LLVM libraries as
1018+
From LLVM 3.5 onward, the CMake build system exports LLVM libraries as
10191019
importable CMake targets. This means that clients of LLVM can now reliably use
10201020
CMake to develop their own LLVM-based projects against an installed version of
10211021
LLVM regardless of how it was built.
10221022

1023-
Here is a simple example of a CMakeLists.txt file that imports the LLVM libraries
1023+
Here is a simple example of a ``CMakeLists.txt`` file that imports the LLVM libraries
10241024
and uses them to build a simple application ``simple-tool``.
10251025

10261026
.. code-block:: cmake
@@ -1054,9 +1054,9 @@ and uses them to build a simple application ``simple-tool``.
10541054
10551055
The ``find_package(...)`` directive when used in CONFIG mode (as in the above
10561056
example) will look for the ``LLVMConfig.cmake`` file in various locations (see
1057-
cmake manual for details). It creates an ``LLVM_DIR`` cache entry to save the
1057+
CMake manual for details). It creates an ``LLVM_DIR`` cache entry to save the
10581058
directory where ``LLVMConfig.cmake`` is found or allows the user to specify the
1059-
directory (e.g. by passing ``-DLLVM_DIR=/usr/lib/cmake/llvm`` to
1059+
directory (e.g., by passing ``-DLLVM_DIR=/usr/lib/cmake/llvm`` to
10601060
the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``).
10611061

10621062
This file is available in two different locations.
@@ -1081,7 +1081,7 @@ The ``LLVMConfig.cmake`` file sets various useful variables. Notable variables
10811081
include:
10821082

10831083
``LLVM_CMAKE_DIR``
1084-
The path to the LLVM CMake directory (i.e. the directory containing
1084+
The path to the LLVM CMake directory (i.e., the directory containing
10851085
``LLVMConfig.cmake``).
10861086

10871087
``LLVM_DEFINITIONS``
@@ -1106,7 +1106,7 @@ include:
11061106
(${LLVM_PACKAGE_VERSION} VERSION_LESS "3.5")``.
11071107

11081108
``LLVM_TOOLS_BINARY_DIR``
1109-
The path to the directory containing the LLVM tools (e.g. ``llvm-as``).
1109+
The path to the directory containing the LLVM tools (e.g., ``llvm-as``).
11101110

11111111
Notice that in the above example we link ``simple-tool`` against several LLVM
11121112
libraries. The list of libraries is determined by using the
@@ -1122,7 +1122,7 @@ and will be removed in a future version of LLVM.
11221122
Developing LLVM passes out of source
11231123
------------------------------------
11241124

1125-
You can develop LLVM passes out of LLVM's source tree (i.e. against an
1125+
You can develop LLVM passes out of LLVM's source tree (i.e., against an
11261126
installed or built LLVM). An example of a project layout is provided below.
11271127

11281128
.. code-block:: none
@@ -1197,6 +1197,6 @@ Windows
11971197
Studio 2010 CMake generator. 0 means use all processors. Default is 0.
11981198

11991199
**CMAKE_MT**:STRING
1200-
When compiling with clang-cl, CMake may use `llvm-mt` as the Manifest Tool
1201-
when available. `llvm-mt` is only present when libxml2 is found at build-time.
1200+
When compiling with clang-cl, CMake may use ``llvm-mt`` as the Manifest Tool
1201+
when available. ```llvm-mt``` is only present when libxml2 is found at build-time.
12021202
To ensure using Microsoft's Manifest Tool set `CMAKE_MT=mt`.

0 commit comments

Comments
 (0)