Commit Graph

1147 Commits

Author SHA1 Message Date
Oleksandr Koval
209daa20b2 Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
2021-01-05 14:32:36 +02:00
Craig Scott
d2456b29f4 Merge topic 'unity-anon-ns'
0fe9c40494 Unity Build: Add option for generating per-file unique id

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4784
2020-12-16 07:40:41 -05:00
Brad King
34469a4f71 Merge topic 'custom-command-output-genex-nmc'
1526ae3aba Tests: Add cases for Ninja Multi-Config cross-config custom commands
dcf9f4d2f7 Ninja Multi-Config: Add support for cross-config custom commands
15467f12f7 cmLocalGenerator: Adopt custom target 'force' output name generation
7b64b0cd5a cmLocalGenerator: Refactor custom command generator construction
d29da8ed3e cmMakefile: Simplify custom target 'force' output name generation
2b1cc175ee Help: Clarify version adding add_custom_{command,target} OUTPUT genex support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5612
2020-12-16 06:20:39 -05:00
Brad King
67f12dd1d6 Merge topic 'ispc_control_header_suffixes'
c9a50f3556 ISPC: Generated Headers suffix configurable with a better default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5597
2020-12-15 07:40:34 -05:00
Brad King
3fb889a0e6 Merge topic 'support_CMAKE_VFS_OVERLAY_for_rc_compilation'
18ee6d7e32 llvm-rc: Add CMAKE_VFS_OVERLAY to the preprocessing flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5604
2020-12-15 07:38:20 -05:00
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
Stephen Kelly
0fe9c40494 Unity Build: Add option for generating per-file unique id
Fixes: #21477
2020-12-15 22:26:09 +11:00
Robert Maynard
c9a50f3556 ISPC: Generated Headers suffix configurable with a better default
The target property `ISPC_HEADER_SUFFIX` and associated global
variable now can control the suffix used when generating the
C/C++ interoperability ISPC headers.

In addition the default suffix is now "_ispc.h" which matches the
common convention that the ISPC compiler team uses and recommends.
2020-12-14 13:13:09 -05:00
Thomas Bernard
18ee6d7e32 llvm-rc: Add CMAKE_VFS_OVERLAY to the preprocessing flags
Issue: #20658
2020-12-14 11:08:12 -05: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
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
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
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
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
Raul Tambre
fcabf4a47e macOS: Add architecture flags only for native ASM dialect
ASM dialects like NASM have languages names such as ASM_NASM.
However such ASM dialects don't support the architecture flags, so match only
the full name.

Fixes #21553.
2020-12-04 17:29:14 +02:00
Brad King
0f00d01717 Merge topic 'pch-ios-multi-arch-nmc'
35432aabda PCH: Fix compiler errors on iOS multi-arch using Ninja Multi-Config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5544
2020-12-01 09:26:58 -05:00
Cristian Adam
35432aabda PCH: Fix compiler errors on iOS multi-arch using Ninja Multi-Config
Fixes: #21401
2020-11-30 13:31:51 -05:00
Deniz Bahadir
7524501d89 PCH: Do not mark PCH-header as generated
The PCH header file itself is written by CMake and is not generated by
part of the buildsystem.  Therefore the `GENERATED` property is not
appropriate to set because the file is always present before the build
starts.  We already do not mark the PCH source file as `GENERATED`
either.

This is a preparation for solving #18399, which will no longer allow to
unset the `GENERATED` property from a source-file once it was set.

Fixes: #21437
Signed-off-by: Deniz Bahadir <dbahadir@benocs.com>
2020-11-16 12:56:54 -05:00
Vitaly Stakhovsky
f6e7d5f3a0 Reduce the scope of temporary cmProp variables and other improvements 2020-11-05 11:07:39 -05:00
vvs31415
f808f27919 cmLocalGenerator::GetRuleLauncher: return cmProp 2020-11-02 13:07:46 -05:00
Asit Dhal
03ad0e61c1 configure_file: Add option for user defined permissions
User defined permissions and options to copy permissions are
implemented.

Fixes: #20866
2020-10-24 12:00:47 +02:00
Cengizhan Pasaoglu
bd705788f6 Constify some code as suggested by clang-tidy 2020-10-20 00:04:04 +03:00
Brad King
0090a11a42 cmLocalGenerator: Migrate custom command output lookup from cmMakefile
Since commit 777ceaea94 (cmMakefile: Delay custom command creation,
2019-10-17, v3.17.0-rc1~352^2) we process custom command declarations at
generate time.  Therefore we do not need to look up what source file
holds the custom command producing a given output until generate time.
2020-10-08 12:20:33 -04:00
Brad King
26464da5d3 cmMakefile: Drop unnecessary custom command APPEND check
Since commit 777ceaea94 (cmMakefile: Delay custom command creation,
2019-10-17, v3.17.0-rc1~352^2) we process custom command declarations
at generate time.  This includes the append-to-non-existing-command
check, so we do not need it at configure time.
2020-10-08 12:20:33 -04:00
Raul Tambre
c63fe01835 CUDA: Clang separable compilation
For NVCC the compiler takes care of device linking when passed the "-dlink"
flag.
Clang doesn't support such magic and requires the buildsystem to do the work
that NVCC does behind the scenes.

The implementation is based on Bazel's device linking documentation:
7cabcdf073/third_party/nccl/build_defs.bzl.tpl (L259)

Closes: #20726
2020-09-24 15:19:54 -04:00
Brad King
7710c94009 Merge topic 'pch-tv90'
ce7c100545 PCH: Fix 30s wait for VS2008 when used via -Tv90

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5199
2020-09-09 11:24:34 -04:00
Cristian Adam
ce7c100545 PCH: Fix 30s wait for VS2008 when used via -Tv90
Fixes: #21142
Backport: release
2020-09-07 19:49:15 +02:00
Robert Maynard
a020787a9b ISPC: Support generation for multiple instruction sets 2020-09-04 08:37:07 -04:00
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Brad King
f10682b796 Merge topic 'ispc_lang_support'
5ece12b7e4 gitlab-ci: add ISPC to the Fedora CI image
8976817d6d ISPC: Update help documentation to include ISPC
2368f46ba4 ISPC: Support building with the MSVC toolchain
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds
34cc6acc81 Add ISPC compiler support to CMake
419d70d490 Refactor some swift only logic to be re-used by other languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5065
2020-09-01 09:15:39 -04:00
Robert Maynard
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds 2020-08-28 11:21:31 -04:00
Brad King
5e212cafba Merge topic 'osx_asm_architectures'
940fc62962 macOS: Respect OSX_ARCHITECTURES for ASM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5152
2020-08-25 10:40:20 -04:00
Raul Tambre
940fc62962 macOS: Respect OSX_ARCHITECTURES for ASM
Fixes #20771.
2020-08-22 09:16:21 +03:00
Kyle Edwards
3ef0c40962 WIN32_EXECUTABLE: Add support for generator expressions 2020-08-21 09:17:27 -04:00
Brad King
0953c0051e Merge topic 'clang-cl-vfs'
20ebaed972 Clang: Add support for passing VFS arguments
d993ebd4ca clang-cl: Add '--' before source file
a94672b919 cmake: Change cmake_llvm_rc separator from -- to ++ to avoid conflict

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5087
2020-08-10 11:33:19 -04:00
Thomas Bernard
20ebaed972 Clang: Add support for passing VFS arguments 2020-08-07 11:52:45 -04:00
Brad King
89e5f95c2b Merge topic 'reuse_pch_no_delay'
ef97fbe6c2 PCH: Avoid unnecessary 30s delay on MSBuild Generator with REUSE_FROM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5102
2020-08-06 10:39:47 -04:00
Cristian Adam
ef97fbe6c2 PCH: Avoid unnecessary 30s delay on MSBuild Generator with REUSE_FROM
Fix logic added by commit 1f791eb160 (Multi-Ninja: Fix reusable PCHs for
MSVC, 2020-05-24, v3.18.0-rc1~72^2) to avoid an unnecessary delay.

Fixes: #21054
2020-08-05 15:52:05 -04:00
Brad King
8878f59cf9 Merge topic 'unity_no_skip_autogen'
7051250a6c Unity Builds: Do not set SKIP_AUTOGEN to source files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5081
2020-07-30 08:28:49 -04:00
Cristian Adam
7051250a6c Unity Builds: Do not set SKIP_AUTOGEN to source files
Fixes: #21028
2020-07-29 17:57:50 +02:00