Brad King
9871190dd7
Merge topic 'ninja-multi-custom-command-deps'
...
081c4679f7 Ninja Multi-Config: Don't build target dependencies for custom commands
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !4423
2020-03-05 07:24:49 -05:00
Brad King
26f728ca78
Merge topic 'ninja-multi-spurious-unused-variables'
...
8b799f80e3 Ninja Multi-Config: Fix spurious unused variable warning
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !4421
2020-03-04 08:18:03 -05:00
Kyle Edwards
8b799f80e3
Ninja Multi-Config: Fix spurious unused variable warning
...
Fixes : #20381
2020-03-03 15:52:36 -05:00
Kyle Edwards
081c4679f7
Ninja Multi-Config: Don't build target dependencies for custom commands
...
If cross-config mode is used, and a target depends on another target
as well as a custom command, we don't want the custom command to also
depend on the depended target, as that would build targets unnecessarily.
Fix this behavior.
2020-03-03 15:15:13 -05:00
Brad King
f18c72815b
Merge topic 'ninja-multi-variable-shuffle-again'
...
c794b70f19 Ninja Multi-Config: Always generate build.ninja
9590c3a400 Generator: Don't allow Ninja Multi-Config variables on other generators
7a63dafafb Ninja Multi-Config: Remove "NMC" from variable names
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !4403
2020-02-28 11:32:07 -05:00
Kyle Edwards
c794b70f19
Ninja Multi-Config: Always generate build.ninja
...
If CMAKE_DEFAULT_BUILD_TYPE is not specified, use the first item
from CMAKE_CONFIGURATION_TYPES instead.
2020-02-27 10:39:35 -05:00
Kyle Edwards
7a63dafafb
Ninja Multi-Config: Remove "NMC" from variable names
...
Also rename `..._DEFAULT_BUILD_FILE_CONFIG` to `..._DEFAULT_BUILD_TYPE`.
These name changes make the variables meaningful for future use by other
generators.
2020-02-27 09:22:08 -05:00
Kyle Edwards
665c8fde8b
Merge branch 'backport-ninja-multi-framework-dependency-autogen-fix' into ninja-multi-framework-dependency-autogen-fix
2020-02-17 10:51:48 -05:00
Kyle Edwards
7abc3d61ac
Ninja Multi-Config: Fix issue with framework dependencies and Autogen
...
Fixes : #20345
2020-02-17 08:24:57 -05:00
Kyle Edwards
72229159d7
Merge topic 'ninja-strcat-usage'
...
6e65b869c3 cmNinjaTargetGenerator: cmStrCat usage
9f6544048f cmGlobalNinjaGenerator: cmStrCat usage
04ac0ea501 cmGlobalNinjaGenerator: factor out /all target name computation
a85bea173a cmGlobalNinjaGenerator: avoid unnecessary string addition
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !4347
2020-02-12 11:59:21 -05:00
Brad King
566a9c8467
Merge topic 'ninja-multi-default-configs-fix'
...
46c836644d Ninja Multi-Config: Fix issue with "all" in CMAKE_NMC_DEFAULT_CONFIGS
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !4349
2020-02-12 09:15:54 -05:00
Kyle Edwards
46c836644d
Ninja Multi-Config: Fix issue with "all" in CMAKE_NMC_DEFAULT_CONFIGS
...
Prior to this fix, CMAKE_NMC_DEFAULT_CONFIGS would inherit "all" from
the union of CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG and
CMAKE_NMC_CROSS_CONFIGS. This is inconsistent with the behavior of the
"all" target signifying CMAKE_NMC_CROSS_CONFIGS. Update "all" in
CMAKE_NMC_DEFAULT_CONFIGS to inherit only from CMAKE_NMC_CROSS_CONFIGS.
2020-02-11 10:49:54 -05:00
Ben Boeckel
9f6544048f
cmGlobalNinjaGenerator: cmStrCat usage
2020-02-11 03:55:50 -05:00
Ben Boeckel
04ac0ea501
cmGlobalNinjaGenerator: factor out /all target name computation
2020-02-11 03:55:50 -05:00
Ben Boeckel
a85bea173a
cmGlobalNinjaGenerator: avoid unnecessary string addition
2020-02-11 03:55:50 -05:00
Brad King
4e44cbc673
Merge topic 'ninja-multi-default-config-fix'
...
1844be451e Ninja Multi-Config: Fix issue with CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !4331
2020-02-07 09:26:37 -05:00
Brad King
135378fd18
Merge topic 'ninja-multi-default-config-fix' into release-3.17
...
1844be451e Ninja Multi-Config: Fix issue with CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !4331
2020-02-07 09:26:36 -05:00
Brad King
6c142ac7aa
Merge topic 'ninja-multi-no-minsizerel'
...
9e219de4fb Ninja Multi-Config: Don't include MinSizeRel by default
Acked-by: Kitware Robot <kwrobot@kitware.com >
Acked-by: Ben Boeckel <ben.boeckel@kitware.com >
Merge-request: !4326
2020-02-07 09:17:26 -05:00
Kyle Edwards
1844be451e
Ninja Multi-Config: Fix issue with CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG
...
Fix an issue where CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG is specified
and CMAKE_NMC_CROSS_CONFIGS is not, which results in a false error
with CMAKE_NMC_DEFAULT_CONFIGS.
2020-02-06 14:31:13 -05:00
Kyle Edwards
9e219de4fb
Ninja Multi-Config: Don't include MinSizeRel by default
2020-02-06 11:07:38 -05:00
Kyle Edwards
65679ed8d9
Ninja: Move rules.ninja into CMakeFiles
...
Since this is an implementation detail, it should not be user-
visible. Move it into the implementation directory.
2020-02-05 13:52:54 -05:00
Kyle Edwards
16a4ba5b31
Ninja Multi-Config: Use build.ninja if cmake --build has no --config
...
If cmake --build is called with no --config argument, and a
build.ninja file is available, use that instead of defaulting to the
Debug config.
2020-02-04 14:13:07 -05:00
Ben Boeckel
f4e02c46fc
cmGlobalNinjaGenerator: run ninja tools in the build directory
...
Fixes : #20303
2020-02-03 15:31:26 -05:00
Kyle Edwards
b966f86d86
Ninja Multi-Config: Shuffle variables around
...
Remove redundant variable CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE.
Rename other variables. Document and improve handling of error
conditions.
2020-02-03 13:27:51 -05:00
Brad King
38ee7db2ac
Merge topic 'mixed-mode-multi-arch'
...
15f6606abd Swift: disallow multiple `CMAKE_OSX_ARCHITECTURES` with Swift
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !4283
2020-01-29 10:32:38 -05:00
Saleem Abdulrasool
15f6606abd
Swift: disallow multiple CMAKE_OSX_ARCHITECTURES with Swift
...
This disallows the use of multiple values in `CMAKE_OSX_ARCHITECTURES`
with Swift which does not support FAT compilation.
2020-01-28 10:13:28 -08:00
Brad King
ccaa0bccc4
Ninja: Do not clean metadata when re-generating inside a running build
...
When `ninja` re-runs CMake to re-generate the build system, do not try
to use the ninja tools to update metadata on Windows. The outer ninja
process is already holding the files open.
Issue: #20274
2020-01-27 15:39:04 -05:00
Brad King
657820a00b
Ninja: Track when running to re-generate during a build
...
Tell CMake explicitly when it is re-running inside a `ninja` invocation
to re-generate the build system.
2020-01-27 15:39:04 -05:00
Brad King
b12b013028
Ninja: Factor metadata cleanup into dedicated method
2020-01-27 15:39:04 -05:00
Brad King
5d92e60d81
Ninja: Skip cleandead and recompact if build.ninja is missing
...
In error cases the `build.ninja` file may not exist. Skip running ninja
tools that require it so that we do not generate additional errors.
2020-01-27 15:09:18 -05:00
Brad King
dd0a4718fd
Ninja: Fix CMAKE_NINJA_OUTPUT_PATH_PREFIX with Ninja 1.10
...
The ninja 1.10 tools we use since commit fb18215904 (Ninja: clean ninja
metadata once generated, 2019-05-13) expect `build.ninja` to be
available and loadable. In commit 6cc74b6140 (cmGlobalNinjaGenerator:
avoid cleandead and recompact in Ninja-Multi, 2020-01-22) we added a
condition to exclude the tools in a case where `build.ninja` is not
available. Generalize that condition using a local variable and extend
it for the case that `build.ninja` is not loadable in the current
directory because it is meant to be a sub-ninja for a higher directory.
2020-01-27 15:09:18 -05:00
Brad King
072a95350c
Merge topic 'ninja-multi-cross-configs'
...
b7a2baf38c Ninja Multi-Config: Add variable to control configs used in cross-config build
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !4269
2020-01-24 15:02:20 -05:00
Brad King
89a93348d5
Merge topic 'multi-ninja-no-cleandead'
...
6cc74b6140 cmGlobalNinjaGenerator: avoid cleandead and recompact in Ninja-Multi
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !4261
2020-01-24 09:17:07 -05:00
Kyle Edwards
b7a2baf38c
Ninja Multi-Config: Add variable to control configs used in cross-config build
2020-01-23 15:47:12 -05:00
Ben Boeckel
6cc74b6140
cmGlobalNinjaGenerator: avoid cleandead and recompact in Ninja-Multi
...
Fixes : #20247
2020-01-23 09:24:46 -05:00
Kyle Edwards
8337ed0d73
Ninja Multi-Config: Add variable to control aliases in build.ninja
2020-01-22 10:26:21 -05:00
Kyle Edwards
110037369d
Refactor: Split Ninja files into impl-<Config>.ninja and build-<Config>.ninja
2020-01-22 10:26:21 -05:00
Kyle Edwards
e62a3414f7
Refactor: Move common.ninja into CMakeFiles
2020-01-22 10:25:35 -05:00
Ben Boeckel
eb2da206d9
cmGlobalNinjaGenerator: only restat build.ninja
...
This reduces the work that ninja needs to do on a CMake reconfigure.
2020-01-21 08:57:51 -05:00
Kyle Edwards
310b58e961
Ninja Multi-Config: Rename variable to be more consistent
...
Also make some tweaks to the documentation.
2020-01-16 10:34:43 -05:00
Brad King
f11b8342a0
Merge topic 'modernize-memory-management'
...
328f586be7 cmAlgorithms.h: remove obsolete helpers
f466cea3c9 cmMakefile: modernize memory management
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !4215
2020-01-15 13:32:00 -05:00
Marc Chevrier
f466cea3c9
cmMakefile: modernize memory management
2020-01-14 11:03:07 +01:00
Kyle Edwards
ca9100c5ce
Ninja Multi-Config: Improve error handling when not doing cross-config build
2020-01-13 11:58:07 -05:00
Kyle Edwards
e8032e202e
Ninja Multi-Config: Make cross-config building opt-in
...
Many users will want to use the Ninja Multi-Config generator like a
traditional Visual Studio-style multi-config generator, which doesn't
mix configurations - custom commands are built using target executables
of the same configuration the command is for. We do not want to force
these people to generate an N*N build matrix when they only need N*1,
especially if they have lots of targets. Add a new variable,
CMAKE_NINJA_CROSS_CONFIG_ENABLE, to opt-in to the cross-config build
matrix.
2020-01-10 16:31:29 -05:00
Brad King
2ee6baef4f
Merge topic 'ninja-postgen-commands'
...
fb18215904 Ninja: clean ninja metadata once generated
Acked-by: Kitware Robot <kwrobot@kitware.com >
Acked-by: Jan Niklas Hasse <jhasse@bixense.com >
Merge-request: !3316
2020-01-10 13:30:35 -05:00
Marc Chevrier
a00960288b
GlobalGenerator family: modernize memory management
2020-01-07 11:03:11 +01:00
Ben Boeckel
fb18215904
Ninja: clean ninja metadata once generated
...
Fixes : #15830
2020-01-06 11:57:08 -05:00
Marc Chevrier
5444a8095d
cmGlobalGenerator: modernize memrory managemenbt
2019-12-30 16:55:39 +01:00
Marc Chevrier
f7d12609f0
Refactoring: use append functions from cmext/algorithm
2019-12-17 10:44:02 +01:00
Kyle Edwards
5a8a9f7229
Ninja: Add multi-config variant
...
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com >
2019-12-13 10:51:46 -05:00