Help: Move Ninja Multi-Config variable details into their respective pages

This commit is contained in:
Kyle Edwards 2020-03-26 15:33:48 -04:00
parent d14626afe5
commit c8fd26eb57
4 changed files with 35 additions and 43 deletions

View File

@ -33,53 +33,19 @@ below for how to enable cross-config mode.
The ``Ninja Multi-Config`` generator recognizes the following variables:
:variable:`CMAKE_CONFIGURATION_TYPES`
Specifies the total set of configurations to build. See the variable's
documentation for more information.
Specifies the total set of configurations to build.
:variable:`CMAKE_CROSS_CONFIGS`
Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of
configurations available from all ``build-<Config>.ninja`` files.
This variable activates cross-config mode.
Targets from each config specified in this variable can be built from any
``build-<Config>.ninja`` file. Custom commands will use the configuration
native to ``build-<Config>.ninja``. If it is set to ``all``, all
configurations from :variable:`CMAKE_CONFIGURATION_TYPES` are cross-configs.
If it is not specified, or empty, each ``build-<Config>.ninja`` file will
only contain build rules for its own configuration.
The value of this variable must be a subset of
:variable:`CMAKE_CONFIGURATION_TYPES`.
:variable:`CMAKE_DEFAULT_BUILD_TYPE`
Specifies the configuration to use by default in a ``build.ninja`` file. If
this variable is specified, ``build.ninja`` uses build rules from
``build-<Config>.ninja`` by default. All custom commands are executed with
this configuration. If the variable is not specified, the first item from
:variable:`CMAKE_CONFIGURATION_TYPES` is used instead.
The value of this variable must be one of the items from
:variable:`CMAKE_CONFIGURATION_TYPES`.
Specifies the configuration to use by default in a ``build.ninja`` file.
:variable:`CMAKE_DEFAULT_CONFIGS`
Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of
configurations to build for a target in ``build.ninja``
if no ``:<Config>`` suffix is specified. If it is set to ``all``, all
configurations from :variable:`CMAKE_CROSS_CONFIGS` are used. If
it is not specified, it defaults to
:variable:`CMAKE_DEFAULT_BUILD_TYPE`.
For example, if you set
:variable:`CMAKE_DEFAULT_BUILD_TYPE` to ``Release``, but
set :variable:`CMAKE_DEFAULT_CONFIGS` to ``Debug`` or ``all``,
all ``<target>`` aliases in ``build.ninja`` will resolve to
``<target>:Debug`` or ``<target>:all``, but custom commands will still use
the ``Release`` configuration.
The value of this variable must be a subset of
:variable:`CMAKE_CROSS_CONFIGS` or be the same as
:variable:`CMAKE_DEFAULT_BUILD_TYPE`. It must not be
specified if :variable:`CMAKE_DEFAULT_BUILD_TYPE` or
:variable:`CMAKE_CROSS_CONFIGS` is not used.
if no ``:<Config>`` suffix is specified.
Consider the following example:

View File

@ -3,5 +3,13 @@ CMAKE_CROSS_CONFIGS
Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of
configurations available from all ``build-<Config>.ninja`` files in the
:generator:`Ninja Multi-Config` generator. See the generator's
documentation for more details.
:generator:`Ninja Multi-Config` generator. This variable activates
cross-config mode. Targets from each config specified in this variable can be
built from any ``build-<Config>.ninja`` file. Custom commands will use the
configuration native to ``build-<Config>.ninja``. If it is set to ``all``, all
configurations from :variable:`CMAKE_CONFIGURATION_TYPES` are cross-configs. If
it is not specified, or empty, each ``build-<Config>.ninja`` file will only
contain build rules for its own configuration.
The value of this variable must be a subset of
:variable:`CMAKE_CONFIGURATION_TYPES`.

View File

@ -2,5 +2,11 @@ CMAKE_DEFAULT_BUILD_TYPE
------------------------
Specifies the configuration to use by default in a ``build.ninja`` file in the
:generator:`Ninja Multi-Config` generator. See the generator's documentation
for more details.
:generator:`Ninja Multi-Config` generator. If this variable is specified,
``build.ninja`` uses build rules from ``build-<Config>.ninja`` by default. All
custom commands are executed with this configuration. If the variable is not
specified, the first item from :variable:`CMAKE_CONFIGURATION_TYPES` is used
instead.
The value of this variable must be one of the items from
:variable:`CMAKE_CONFIGURATION_TYPES`.

View File

@ -3,5 +3,17 @@ CMAKE_DEFAULT_CONFIGS
Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of configurations
to build for a target in ``build.ninja`` if no ``:<Config>`` suffix is specified in
the :generator:`Ninja Multi-Config` generator.
See the generator's documentation for more details.
the :generator:`Ninja Multi-Config` generator. If it is set to ``all``, all
configurations from :variable:`CMAKE_CROSS_CONFIGS` are used. If it is not
specified, it defaults to :variable:`CMAKE_DEFAULT_BUILD_TYPE`.
For example, if you set :variable:`CMAKE_DEFAULT_BUILD_TYPE` to ``Release``,
but set :variable:`CMAKE_DEFAULT_CONFIGS` to ``Debug`` or ``all``, all
``<target>`` aliases in ``build.ninja`` will resolve to ``<target>:Debug`` or
``<target>:all``, but custom commands will still use the ``Release``
configuration.
The value of this variable must be a subset of :variable:`CMAKE_CROSS_CONFIGS`
or be the same as :variable:`CMAKE_DEFAULT_BUILD_TYPE`. It must not be
specified if :variable:`CMAKE_DEFAULT_BUILD_TYPE` or
:variable:`CMAKE_CROSS_CONFIGS` is not used.