1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-19 19:36:41 +08:00

358 Commits

Author SHA1 Message Date
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Brad King
6064c70469 Merge topic 'cuda_separable_clang_make'
3975678fcc CUDA/Clang: Simplify --register-link-binaries logic
0b1cea66cd CUDA/Clang: Fix separable compilation in non-root directories with Makefiles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6400
2021-07-29 08:45:40 -04:00
root
3975678fcc CUDA/Clang: Simplify --register-link-binaries logic
Move the logic for appending cubin afterwards, so the check can simply be
empty().
With the Makefile generator the option is now at the front instead of being
intermixed with the actual bins.
2021-07-29 13:19:37 +03:00
Marc Chevrier
14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration
Currently, this feature is only supported on ELF platforms. So, the property
LINK_WHAT_YOU_USE will be ignored for other plateforms.
Moreover, flags and commands are now controled by CMake variables.

Fixes: #20174
2021-07-09 14:50:50 +02:00
Đoàn Trần Công Danh
d7159f9591 Ninja: Fix LINK_WHAT_YOU_USE link flag placement
Move `-Wl,--no-as-needed` from the `<FLAGS>` placeholder to
`<LINK_FLAGS>`, as it is in the Makefile generators.

Fixes: #22342
2021-06-25 08:45:47 -04:00
Bobby D Reynolds
ae108418ae Launchers: Support setting linker launchers
Fixes: #18316
2021-05-28 12:28:43 -04:00
Bobby D Reynolds
92c8b83641 cmNinjaNormalTargetGenerator: Fix "Language" rule variable
Fixes: commit 3bc63e99e4 (Refactor: Prepare Ninja generator for multi-config, 2019-11-14, v3.17.0-rc1~290^2~3)
2021-05-28 12:28:43 -04:00
Brad King
48471cfd18 cmNinjaNormalTargetGenerator: Factor out build event byproduct collection
This was left out of commit 68e5f92cad (cmGlobalNinjaGenerator: Factor
out custom command output collection, 2021-05-18).
2021-05-25 10:48:26 -04:00
Brad King
fb3a57575a cmNinjaTargetGenerator: Rename source file path lookup method for clarity
The `GetSourceFilePath` method is meant only for compiled sources, and
automatically handles converting it to a path for the Ninja build
manifest.  Rename the method to clarify both.
2021-05-25 10:48:25 -04:00
Brad King
ef553410e2 Ninja/Swift: Remove redundant calls to ConvertToNinjaPath
`GetSourceFilePath` already handles converting to a Ninja path.
2021-05-25 10:48:25 -04:00
Brad King
4419b944fd Merge topic 'ninja-multi-long-command-line-config'
ad08f93ee4 Ninja Multi-Config: Split long command lines by config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6067
2021-05-03 10:53:50 -04:00
Kyle Edwards
ad08f93ee4 Ninja Multi-Config: Split long command lines by config
Fixes: #22123
2021-04-30 14:46:21 -04:00
Alexander Stein
c0a3317497 Ninja: Escape SONAME on linker command line
If the shared object name contains spaces, they need to be properly
escaped, or link command will fail.

This was already done for soname symlink creation in commit 13c92b4a30
(Ninja: Fix creation of library symlinks in folders with spaces,
2019-05-20, v3.15.0-rc1~87^2).

Fixes: #20331
2021-03-04 15:44:49 -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
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
vvs31415
f808f27919 cmLocalGenerator::GetRuleLauncher: return cmProp 2020-11-02 13:07:46 -05: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
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
06427db62c Merge topic 'ninja-multi-rsp-remove-path'
cdb50af2f6 Ninja: Restore shorter path to response files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: alcroito <alexandru.croitor@qt.io>
Merge-request: !5094
2020-08-06 10:28:27 -04:00
Kyle Edwards
cdb50af2f6 Ninja: Restore shorter path to response files
In commit 99ed39b011 (Ninja Multi-Config: Make link response files
per-config, 2020-07-15, v3.17.4~3^2), we added the target directory to
the response file under the mistaken assumption that two different
targets with the same name could be in different directories. However,
this causes the path to the response file to be too long to fit on a
command line.  Take the path back out, while leaving in the per-config
split.

Fixes: #21050
2020-08-03 12:14:16 -04:00
Vitaly Stakhovsky
f37c14e930 Source: use cmNonempty() 2020-07-28 08:31:31 -04:00
Kyle Edwards
cfe2dc4721 Ninja: Remove parameter default for cmNinjaTargetDepends 2020-07-24 11:49:59 -04:00
Brad King
286411ed89 Merge topic 'ninja-multi-rsp'
99ed39b011 Ninja Multi-Config: Make link response files per-config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5020
2020-07-17 08:49:37 -04:00
Kyle Edwards
99ed39b011 Ninja Multi-Config: Make link response files per-config
Fixes: #20961
2020-07-16 11:57:46 -04:00
Vitaly Stakhovsky
eaad8072ee cmNonempty: Convenience inlines to check for non-empty string 2020-07-14 15:18:59 -04:00
Brad King
a432b1075c Merge topic 'getdef-expand'
7ed8c9ebe3 cmMakefile: add GetDefExpandList() that splits value into std::vector

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4819
2020-06-02 08:02:24 -04:00
Brad King
fff14290d2 Merge topic 'cmprop'
b36d1bdd9d Single location for cmProp typedef

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4829
2020-06-02 08:00:55 -04:00
Vitaly Stakhovsky
b36d1bdd9d Single location for cmProp typedef 2020-06-01 08:54:20 -04:00
Vitaly Stakhovsky
7ed8c9ebe3 cmMakefile: add GetDefExpandList() that splits value into std::vector
Combines cmMakefile:GetDefinition() and cmExpandList()
2020-05-30 08:59:20 -04:00
Vitaly Stakhovsky
1e805f53f5 GetDefinition: avoid duplicate calls 2020-05-29 13:12:22 -04:00
Brad King
3fa3b7a402 cmGeneratorTarget: Remove default config from Get* methods
Ensure all call sites pass an explicit configuration.
2020-05-18 12:56:56 -04:00
Vitaly Stakhovsky
36aba01223 cmGeneratorTarget::GetProperty: return cmProp 2020-04-29 10:59:39 -04:00
Marc Chevrier
4248bb452a CUDA: Device linking use now link options
properties LINK_OPTIONS and INTERFACE_LINK_OPTIONS are propagated
to the device link step.

To control which options are selected for normal link and device link steps,
the $<DEVICE_LINK> and $<HOST_LINK> generator expressions can be used.

Fixes: #18265
2020-04-19 15:53:11 +02:00
Vitaly Stakhovsky
ef408dd232 cmState::GetTargetTypeName: return type is *cmProp 2020-03-19 08:55:03 -04:00
Kyle Edwards
87819db28d Merge branch 'backport-swift-ninja-multiconfig' into swift-ninja-multiconfig 2020-03-09 09:12:54 -04:00
Saleem Abdulrasool
65b3848de0 Swift: support Ninja Multi-Config
Enable support for multi-configuration builds using Ninja when building
Swift.
2020-03-09 09:11:22 -04:00
Alexandru Croitor
ad3f69c86e Add support for FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG> 2020-03-04 14:30:54 +01:00
Brad King
7da2c8c543 Merge branch 'backport-cuda-non-device-link' 2020-02-24 13:34:13 -05:00
Francisco Facioni
738f3f23aa Ninja: Do not use nvcc response files with non-nvcc tools
Since commit d91b5a72cd (Ninja: Add support for CUDA nvcc response
files, 2019-05-30, v3.15.0-rc1~8^2) we use NVCC's `--options-file`
option to avoid long link command lines via a response file.  However,
for non-device linking the host tools are used and the option does not
make sense.  Update the logic to use `--options-file` only for device
linking.  Linking with the host tools already has its own logic for
response files.

Fixes: #19954
2020-02-24 13:31:33 -05:00
Brad King
451ce7e410 Merge topic 'swift-exe-exports'
1e26d57188 Ninja: properly handle exports from Swift exes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4314
2020-02-04 08:27:49 -05:00
Saleem Abdulrasool
1e26d57188 Ninja: properly handle exports from Swift exes
This adds logic to properly handle Swift executables.  Only executables
marked as exporting symbols will now generate module interfaces for the
executable.
2020-02-01 17:25:57 -08:00
Brad King
afcd9fe669 AIX: Add an option to disable automatic exports from shared libraries
Since commit 0f150b69d3 (AIX: Explicitly compute shared object exports
for both XL and GNU, 2019-07-11, v3.16.0-rc1~418^2~2) we always export
all symbols from shared libraries by default.  Add a new target property
called `AIX_EXPORT_ALL_SYMBOLS` that can be explicitly set to OFF to
suppress this behavior and export no symbols by default.

Fixes: #20290
2020-01-31 09:34:06 -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
110037369d Refactor: Split Ninja files into impl-<Config>.ninja and build-<Config>.ninja 2020-01-22 10:26:21 -05:00
Robert Maynard
c7ac13e8ed CUDA: Mult-Config Ninja generator now supports CUDA 2020-01-13 12:50:37 -05:00
Brad King
041e58d195 Merge topic 'ninja-cross-build-disable'
e8032e202e Ninja Multi-Config: Make cross-config building opt-in

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4205
2020-01-13 10:34:18 -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
Marc Chevrier
968477517e Refactoring: suppress cmEraseIf in favor of cm::erase_if 2020-01-09 11:19:20 +01:00
Marc Chevrier
5444a8095d cmGlobalGenerator: modernize memrory managemenbt 2019-12-30 16:55:39 +01:00