Commit Graph

29990 Commits

Author SHA1 Message Date
Kyle Edwards dcf9f4d2f7 Ninja Multi-Config: Add support for cross-config custom commands
Co-Author: Brad King <brad.king@kitware.com>
2020-12-15 07:01:21 -05:00
Brad King 15467f12f7 cmLocalGenerator: Adopt custom target 'force' output name generation 2020-12-15 07:00:53 -05:00
Brad King 7b64b0cd5a cmLocalGenerator: Refactor custom command generator construction
Add support for constructing and using multiple generators for one
custom command.  cmGeneratorTarget contains a code path that needs this
behavior when used with Ninja but not other generators, so use virtual
dispatch through cmLocalGenerator.
2020-12-15 07:00:52 -05:00
Brad King d29da8ed3e cmMakefile: Simplify custom target 'force' output name generation
Remove unnecessary check of policy CMP0049.  The policy can never
trigger on our internally-generated name because it has no variable
references.

The rename in commit 0ed5ce4cd8 (cmTarget: Rename AddSource method for
backward compatibility., 2014-03-17, v3.1.0-rc1~688^2~17) made it look
like this code path depended on CMP0049.  Then commit 0e1faa28cb
(cmMakefile: Separate custom command setup from actual creation,
2019-09-14, v3.16.0-rc1~85^2) and commit ea1bed34b2 (cmMakefile: Extract
utilities used for creation of custom commands, 2019-09-21,
v3.16.0-rc1~52^2~1) built additional infrastructure to thread that
dependence through the call stack.  Remove it all.
2020-12-15 07:00:52 -05:00
Brad King fedfe763ee Merge topic 'custom-command-output-genex'
c257c25419 add_custom_{command,target}: Add genex support to OUTPUT and BYPRODUCTS
f36af9228b cmLocalGenerator: Evaluate generator expressions in custom command outputs
c887cefd9a cmLocalGenerator: Simplify custom command output cmSourceFile creation
947ba01bf9 cmLocalGenerator: Factor out helper to expand custom command output paths
1902d28ebc cmLocalGenerator: Refactor UpdateOutputToSourceMap to avoid boolean trap
e4034eabe9 cmLocalGenerator: Re-order logic in CreateGeneratedSource
706c48301d cmCustomCommandGenerator: Treat relative outputs w.r.t. build dir
5d23c5446e cmCustomCommandGenerator: Refactor OUTPUT and DEPENDS path evaluation
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Acked-by: Pavel Solodovnikov <hellyeahdominate@gmail.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !5402
2020-12-14 07:22:45 -05:00
Brad King f62bcd08aa Merge topic 'makefiles-compiler-deps-optims'
b2ff3c52df cmDependsCompiler: rely now on cmGccDepfileReader for depfile parser

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5599
2020-12-14 07:16:05 -05:00
Brad King 06dae10c9b Merge topic 'automoc-autouic-autorcc-not-csharp'
f65f20938c Autogen: Avoid processing CSharp targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5507
2020-12-14 07:15:01 -05:00
Brad King f70814c3fd Merge topic 'install-properties'
63db7ae9c4 cmake: Clear INSTALL file properties between runs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5603
2020-12-14 07:08:49 -05:00
Brad King 922ad5c6b9 Merge topic 'execute_process-command-error'
e5a4ffaad1 execute_process: Improve COMMAND_ERROR_IS_FATAL error capture scenarios

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5588
2020-12-14 07:07:46 -05:00
Kitware Robot 0a6c7cdd07 CMake Nightly Date Stamp 2020-12-14 00:01:19 -05:00
Kitware Robot 703a58cba3 CMake Nightly Date Stamp 2020-12-13 00:02:09 -05:00
Kitware Robot 4621ffb028 CMake Nightly Date Stamp 2020-12-12 00:01:10 -05:00
Brad King 63db7ae9c4 cmake: Clear INSTALL file properties between runs
Do not keep state across separate project configurations.
This is particularly important in `cmake-gui` where those
configurations can be for separate projects.

Fixes: #21580
2020-12-11 12:30:27 -05:00
Alessandro Ambrosano f65f20938c Autogen: Avoid processing CSharp targets
Fixes: #21442
2020-12-11 11:37:11 -05:00
Marc Chevrier b2ff3c52df cmDependsCompiler: rely now on cmGccDepfileReader for depfile parser
To avoid duplicate effort of depfile parsing and enhance robustness
of parsing against mal-formed depfiles in preparation of DEPFILE option
support of add_custom_command command for makefiles generators.
2020-12-11 14:48:00 +01:00
Brad King c257c25419 add_custom_{command,target}: Add genex support to OUTPUT and BYPRODUCTS
Move rejection of `#`, `<`, and `>` characters in outputs and byproducts
to a generate-time check.  This removes the front-end check that
disallowed generator expressions.  The generators have already been
updated to handle them.

Fixes: #12877
2020-12-11 08:24:21 -05:00
Brad King f36af9228b cmLocalGenerator: Evaluate generator expressions in custom command outputs
Custom commands with generator expressions in their OUTPUTs or
BYPRODUCTS are still attached to a single `.rule` file.  We use an
internal map to look up the source file holding the custom command for a
given output.  Populate this map using the outputs and byproducts from
all configurations after evaluating the generator expressions for each
configuration.

Issue: #12877
2020-12-11 08:24:06 -05:00
Kitware Robot adc6a4c540 CMake Nightly Date Stamp 2020-12-11 00:01:08 -05:00
Brad King c887cefd9a cmLocalGenerator: Simplify custom command output cmSourceFile creation
Move calls to `CreateGeneratedSource` over to `UpdateOutputToSourceMap`,
which is called for all generated outputs and byproducts.
2020-12-10 07:06:21 -05:00
Brad King 947ba01bf9 cmLocalGenerator: Factor out helper to expand custom command output paths 2020-12-10 07:06:21 -05:00
Brad King 1902d28ebc cmLocalGenerator: Refactor UpdateOutputToSourceMap to avoid boolean trap 2020-12-10 07:06:20 -05:00
Brad King e4034eabe9 cmLocalGenerator: Re-order logic in CreateGeneratedSource
Return early on errors to reduce nesting.
2020-12-10 07:06:20 -05:00
Brad King 706c48301d cmCustomCommandGenerator: Treat relative outputs w.r.t. build dir
The `add_custom_command` and `add_custom_target` commands already do
this for plain output and byproduct paths.  Perform the same conversion
for such paths discovered after generator expression evaluation too.
2020-12-10 07:06:20 -05:00
Brad King 5d23c5446e cmCustomCommandGenerator: Refactor OUTPUT and DEPENDS path evaluation
* Use value semantics.
* Normalize paths in a separate loop.
* If CollapseFullPath is used, ConvertToUnixSlashes is unnecessary.
2020-12-10 07:06:20 -05:00
Brad King 24156c0269 cmCustomCommandGenerator: Evaluate generator expressions in outputs
This was already done for byproducts by commit a583b7bc17 (Genex:
Evaluate byproduct generator expressions in cmCustomCommandGenerator,
2019-09-11, v3.16.0-rc1~86^2).  Like that commit, this does not actually
expose the feature to projects because the front-end commands still
reject generator expressions.

Issue: #12877
2020-12-10 07:06:20 -05:00
Brad King b285748f79 cmAddCustom{Command,Target}Command: Skip conversions on genex paths
If an output or byproduct path starts in a generator expression, do not
convert it to a full path yet.  That will have to be done at generate
time after evaluating the generator expressions.

Also update the `add_custom_target` byproduct path conversion added by
commit 445ff5ccdf (Byproducts: collapse full paths of custom target
byproducts, 2019-09-11, v3.16.0-rc1~103^2~1) to match the behavior of
`add_custom_command` when a path starts in a generator expression.
2020-12-10 07:06:20 -05:00
Brad King 9109475bfb Merge topic 'cpp23'
9f3c70a333 CUDA, CXX, OBJCXX: C++23 support with Clang 12
af7e1545c8 CUDA, CXX: Remove HAS_FULL_SUPPORT for C++17 and 20

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5576
2020-12-10 07:00:17 -05:00
Asit Dhal e5a4ffaad1 execute_process: Improve COMMAND_ERROR_IS_FATAL error capture scenarios
1.  COMMAND_ERROR_IS_FATAL ANY will capture errors if the exit code is
    non zero, there is a timeout or an abnormal exit.

2.  COMMAND_ERROR_IS_FATAL LAST
    will capture if only the last process has an exit code non zero, there
    is a timeout or an abnormal exit.

Fixes: #21562
2020-12-10 06:09:59 -05:00
Kitware Robot 7d4a6ce714 CMake Nightly Date Stamp 2020-12-10 00:01:09 -05:00
Brad King 3c68404c20 Merge topic 'xcode-ios-empty-sticker-pack'
0a60d1b6b4 Allow empty source file list for iOS Sticker packs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5587
2020-12-09 09:16:34 -05:00
Brad King acc9c89914 Merge topic 'cmp0116-automoc'
1080935732 AutoGen: Account for CMP0116 in the depfile
287c591079 cmake -E: Fix cmake_transform_depfile escaping of transformed paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !5584
2020-12-09 09:14:00 -05:00
Kitware Robot d5b12ddcbc CMake Nightly Date Stamp 2020-12-09 00:01:14 -05:00
Kyle Edwards 1080935732 AutoGen: Account for CMP0116 in the depfile
Fixes: #21467
2020-12-08 14:51:36 -05:00
Brad King 287c591079 cmake -E: Fix cmake_transform_depfile escaping of transformed paths
In commit b2c14bc774 (cmake -E: Add cmake_transform_depfile internal
command, 2020-10-02) we forgot to use `WriteFilenameGcc` in one place.
2020-12-08 14:51:36 -05:00
Raul Tambre 9f3c70a333 CUDA, CXX, OBJCXX: C++23 support with Clang 12
Clang 12 landed initial support for C++23 language mode flag -std={c|gnu}++2b
in commit 6627a3c2873fdf7ccba1a1573371079be48b36e8.
2020-12-08 18:43:59 +02:00
Brad King 7775cbdb82 Merge topic 'range-for-avoid-tmp-warning'
99a26babb1 Cleanup: Fix warning about binding to a temporary in range-based for

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5578
2020-12-08 10:21:33 -05:00
Brad King d00d5ac0cd Merge topic 'correct_ispc_path_computation' into release-3.19
9af93fef11 ISPC: Handle OBJECT sources in different directories
72ae15ebcb ISPC: Ninja properly compute ISPC_HEADER_DIRECTORY location

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5581
2020-12-08 10:17:33 -05:00
Brad King 60d95fe2c2 Merge topic 'correct_ispc_path_computation'
9af93fef11 ISPC: Handle OBJECT sources in different directories
72ae15ebcb ISPC: Ninja properly compute ISPC_HEADER_DIRECTORY location

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5581
2020-12-08 10:17:33 -05:00
Kitware Robot f970f4c301 CMake Nightly Date Stamp 2020-12-08 00:01:11 -05:00
Craig Scott 99a26babb1 Cleanup: Fix warning about binding to a temporary in range-based for 2020-12-08 08:32:30 +11:00
Brad King e94f00dfe3 Merge topic 'get_dir_prop_arg_parsing'
ab1ee5aab8 get_directory_property: Check for empty or missing property name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5577
2020-12-07 10:29:16 -05:00
Brad King afd495decd Merge topic 'asm_arch'
fcabf4a47e macOS: Add architecture flags only for native ASM dialect

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5572
2020-12-07 10:28:18 -05:00
Robert Maynard 9af93fef11 ISPC: Handle OBJECT sources in different directories 2020-12-07 09:14:54 -05:00
Robert Maynard 72ae15ebcb ISPC: Ninja properly compute ISPC_HEADER_DIRECTORY location 2020-12-07 09:14:13 -05:00
Kitware Robot a37ef1b3d4 CMake Nightly Date Stamp 2020-12-07 00:01:17 -05:00
Andrew Shaitorov 0a60d1b6b4 Allow empty source file list for iOS Sticker packs 2020-12-06 11:31:26 -05:00
Kitware Robot 0ab0fe64ac CMake Nightly Date Stamp 2020-12-06 00:01:14 -05:00
Craig Scott ab1ee5aab8 get_directory_property: Check for empty or missing property name
Fixes: #21555
2020-12-06 09:38:12 +11:00
Craig Scott 14576a40ac Merge topic 'remove-WCDH-module'
da7ad7997e WriteCompilerDetectionHeader: Add policy to remove module
541f1410e0 Help: Move Documentation module to list of deprecated modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5573
2020-12-05 06:23:55 -05:00
Brad King da7ad7997e WriteCompilerDetectionHeader: Add policy to remove module
See justification in the policy documentation.

Closes: #17842
2020-12-05 21:57:08 +11:00