Commit Graph

39 Commits

Author SHA1 Message Date
Kyle Edwards ad08f93ee4 Ninja Multi-Config: Split long command lines by config
Fixes: #22123
2021-04-30 14:46:21 -04:00
Kyle Edwards f8e2a74712 Ninja Multi-Config: Correctly generate POST_BUILD custom targets
Fixes: #22096
2021-04-22 15:51:53 -04:00
Brad King 6dd89529e8 Ninja Multi-Config: Fix crash on custom command config with no output
With generator expressions in a custom command's `OUTPUT` and
`BYPRODUCTS`, it is possible to have no outputs at all for a particular
configuration.  Generate no rule in this case.

Fixes: #21989
2021-03-29 09:56:43 -04:00
Kyle Edwards 3b864b2583 Ninja Multi-Config: Include configs in long CC scripts
Fixes: #21973
2021-03-25 13:18:47 -04:00
Brad King ccbedb80e4 Ninja Multi-Config: Restore rebuild_cache and edit_cache targets
Since commit dcf9f4d2f7 (Ninja Multi-Config: Add support for
cross-config custom commands, 2020-12-09) we were not generating these
targets.  Restore them and add a test.

Fixes: #21722
2021-01-25 15:22:53 -05:00
Kyle Edwards 98805a11ce Ninja Multi-Config: Run POST_BUILD when BYPRODUCTS don't overlap
Fixes: #21252
2021-01-07 11:26:17 -05:00
Brad King 1526ae3aba Tests: Add cases for Ninja Multi-Config cross-config custom commands 2020-12-15 08:17:55 -05:00
Brad King e0a7c0d40d Tests: Fix one RunCMake.NinjaMultiConfig case name
The CustomCommandGenerator `debug-in-release-graph-clean` case actually
cleans using the Debug graph.  This is intentional in order to test
cleaning only the Debug parts, so fix the test name rather than changing
what graph it uses.
2020-11-02 10:25:54 -05:00
Kyle Edwards b8937a992b Merge branch 'release' into ninja-multi-per-config-sources 2020-10-26 15:43:57 -04:00
Kyle Edwards d13bd6ec3d Ninja Multi-Config: Don't try to calculate dependencies for "all" 2020-10-26 15:37:04 -04:00
Brad King 5d952fd6e2 Merge topic 'ninja-multi-automoc-regression'
23fe4b861f Ninja Multi-Config: Fix dependencies of custom commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5238
2020-09-18 08:42:28 -04:00
Kyle Edwards 23fe4b861f Ninja Multi-Config: Fix dependencies of custom commands
a9fd3a10 addressed the scenario where the depending target is a
utility target, but not the scenario where the dependent target is
a utility target. Account for this scenario.

Also add a Qt-specific test case.

Fixes: #21118
2020-09-17 15:46:57 -04:00
Kyle Edwards 2a6471dd7b Merge branch 'master' into ninja-multi-automoc-regression 2020-09-02 14:39:04 -04:00
Kyle Edwards a9fd3a107d Ninja Multi-Config: Fix dependencies of utility targets
Fixes: #21118
2020-09-02 12:59:59 -04:00
Kyle Edwards c35d1927a5 Tests: Pass additional Qt information to Ninja and NMC tests 2020-09-01 16:58:58 -04:00
Joerg Bornemann 2cdaf43d96 Allow generator expressions in the EXCLUDE_FROM_ALL target property
This allows for setting EXCLUDE_FROM_ALL, conditional on the build
configuration. However, only the Ninja Multi-Config generator supports
different property values per config. All other multi-config
generators will yield an error in that situation.

Fixes: #20923
2020-07-21 17:16:26 +02:00
Brad King 99ab9212f0 Merge topic 'ninja-multi-install'
dddb4f02f7 Ninja Multi-Config: Make "install" targets depend on default configs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4778
2020-05-25 10:33:26 -04:00
Kyle Edwards dddb4f02f7 Ninja Multi-Config: Make "install" targets depend on default configs
And add an "install:all" target.

Fixes: #20713
2020-05-22 13:15:50 -04:00
Brad King 4c7cc264af Tests: Restore NVCC-specific CUDA tests
In commit a653ca9504 (Tests: Update CUDA tests to work with Clang,
2020-03-27) some tests were conditioned using `CMAKE_CUDA_COMPILER_ID`.
That is not defined when configuring CMake itself, so it accidentally
turned off NVCC-specific CUDA tests altogether.  Convert the conditions
to check `CMake_TEST_CUDA` for `Clang` instead.  That option is added
explicitly to builds where we want the tests to run, so we can set it to
a value indicating the CUDA compiler vendor.

In commit a653ca9504 (Tests: Update CUDA tests to work with Clang,
2020-03-27) the NVCC-specific `CudaOnly.GPUDebugFlag` test was
accidentally broken by removing a space when appending `-G` to the CUDA
flags.  This was covered by the test not running.  Restore the space.

Fixes: #20727
2020-05-20 10:48:20 -04:00
Raul Tambre a653ca9504 Tests: Update CUDA tests to work with Clang 2020-05-15 18:12:39 +03:00
Kyle Edwards 8b799f80e3 Ninja Multi-Config: Fix spurious unused variable warning
Fixes: #20381
2020-03-03 15:52:36 -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 7abc3d61ac Ninja Multi-Config: Fix issue with framework dependencies and Autogen
Fixes: #20345
2020-02-17 08:24:57 -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
Kyle Edwards 67102d3252 Ninja Multi-Config: Add support for DEPFILE option in add_custom_command()
And give other generators a path forward to add support in the future.
2020-02-07 14:18:54 -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
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 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
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
Kyle Edwards 63c9cd2088 Ninja Multi-Config: Fix bug with MacOS frameworks 2020-01-24 17:16:25 -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
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 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
Robert Maynard c7ac13e8ed CUDA: Mult-Config Ninja generator now supports CUDA 2020-01-13 12:50:37 -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
Kyle Edwards e0478cc646 Tests: Add test for Multi-Configuration Ninja generator 2019-12-13 10:52:07 -05:00