Ninja Multi-Config: Add variable to control aliases in build.ninja

This commit is contained in:
Kyle Edwards
2020-01-17 16:00:28 -05:00
parent 110037369d
commit 8337ed0d73
10 changed files with 192 additions and 14 deletions
+10 -1
View File
@@ -78,4 +78,13 @@ targets built with the generated code.
As a convenience, ``Ninja Multi-Config`` offers a
:variable:`CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE` setting. If this variable is
specified, a ``build.ninja`` file will be generated which points to the
specified ``build-<Config>.ninja`` file.
specified ``build-<Config>.ninja`` file. In addition, if
:variable:`CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE` is used in conjunction with
:variable:`CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE`, you can also specify
:variable:`CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS`, which changes the config
of the ``<target>`` targets in ``build.ninja``. For example, if you set
:variable:`CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE` to ``Release``, but set
:variable:`CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS` 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.
+1
View File
@@ -425,6 +425,7 @@ Variables that Control the Build
/variable/CMAKE_MSVCIDE_RUN_PATH
/variable/CMAKE_MSVC_RUNTIME_LIBRARY
/variable/CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE
/variable/CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS
/variable/CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE
/variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX
/variable/CMAKE_NO_BUILTIN_CHRPATH
@@ -0,0 +1,6 @@
CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS
-------------------------------------
Controls the config of ``<target>`` aliases in ``build.ninja`` for the
:generator:`Ninja Multi-Config` generator. See the generator's documentation
for more details.