summaryrefslogtreecommitdiffstats
path: root/Source/cmLinkLineDeviceComputer.cxx
Commit message (Collapse)AuthorAgeFilesLines
* CUDA: Add Device LTO support for nvccRobert Maynard2022-07-221-0/+20
| | | | Fixes #22200
* remove unused variablesRobert Maynard2022-07-131-1/+0
|
* LINK_LIBRARIES: Evaluate separately for linking and usage requirementsBrad King2022-03-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | We evaluate `LINK_LIBRARIES` and `INTERFACE_LINK_LIBRARIES` for two purposes: * Constructing the link line. * Collecting usage requirements. We evaluate `INTERFACE_LINK_LIBRARIES` separately for each purpose in order to support the `$<LINK_ONLY:...>` generator expression used to express private link dependencies of a static library. Previously we only evaluated `LINK_LIBRARIES` for linking, and used that result for collecting usage requirements too. Therefore `$<LINK_ONLY:...>` does not work in `LINK_LIBRARIES`. With the introduction of `INTERFACE_LINK_LIBRARIES_DIRECT`, evaluation of `LINK_LIBRARIES` now needs to distinguish these two cases in order to honor link dependencies encountered through `$<LINK_ONLY:...>` without also exposing other usage requirements through private dependencies of a static library. Revise internal infrastructure to distinguish the two cases when evaluating `LINK_LIBRARIES`. Make the information available in code paths for `INTERFACE_LINK_LIBRARIES_DIRECT` and `LINK_ONLY`. Defer actually using the information to later commits. Issue: #22496
* Genex: Add $<LINK_LIBRARY:...>Marc Chevrier2022-02-071-3/+5
| | | | | | | | This generator expression offers the capability, for the link step, to decorate libraries with prefix/suffix flags and/or adding any specific flag for each library. Fixes: #22812, #18751, #20078, #22703
* Rename cmProp in cmValueMarc Chevrier2021-09-211-2/+2
|
* cmComputeLinkInformation: Improve type safety of item IsPath memberBrad King2021-05-291-1/+1
| | | | Use an enum to avoid implicit conversions to bool.
* clang-tidy: fix `readability-use-anyofallof` warningsBen Boeckel2021-01-271-10/+9
|
* cmIsOn: add overload accepting const std::string*Vitaly Stakhovsky2020-07-141-14/+11
|
* Single location for cmProp typedefVitaly Stakhovsky2020-06-011-0/+1
|
* cmGeneratorTarget::GetProperty: return cmPropVitaly Stakhovsky2020-04-291-4/+4
|
* Refactoring: add cm::contains to <cmext/algorithm>Marc Chevrier2020-04-171-2/+3
|
* Propagate backtraces from LINK_LIBRARIES through to link line itemsBrad King2020-02-101-5/+5
| | | | | | | | | | | | | Since commit d4d0dd0f6a (cmLinkLineComputer: Add ComputeLinkLibs overload with backtraces, 2019-09-13, v3.16.0-rc1~87^2~4), backtraces have been collected by `ComputeLinkLibs` by looking back through the link implementation libraries for one matching the text of the link line item. This is slow in projects with long link lines. Instead, teach `cmComputeLinkDepends` and `cmComputeLinkInformation` to carry backtrace information explicitly along with the text of each item. Fixes: #20322
* Merge branch 'backport-3.15-cuda-device-link-only-cuda'Brad King2020-01-091-17/+17
|\
| * CUDA: Do not device link if target has no CUDA usageRobert Maynard2020-01-091-18/+18
| | | | | | | | | | | | | | | | | | | | When CUDA is enabled, and a pure non-CUDA target has CMAKE_CUDA_SEPARABLE_COMPILATION enabled, don't actually perform the device linking step, as it will fail. A target that has CMAKE_CUDA_SEPARABLE_COMPILATION enabled must also have CUDA usage (either itself, or something it links to). Fixes: #20182
| * Merge branch 'cuda-imported-library-device-linking' into release-3.15Brad King2019-07-101-6/+11
| |\ | | | | | | | | | Merge-request: !3526
* | | cmLinkLineComputer: Add ComputeLinkLibraries overload with backtracesJustin Goshi2019-09-181-14/+27
| | |
* | | CUDA: static lib device linking computes required static libsRobert Maynard2019-09-051-0/+4
| | | | | | | | | | | | | | | | | | Previously the CMake didn't compute the required set of libraries needed to properly device link a static library when CUDA_RESOLVE_DEVICE_SYMBOLS was enabled.
* | | clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-2/+2
| | |
* | | Merge topic 'cm-contains'Brad King2019-08-211-7/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2dfc52675c cmAlgorithms: Add cmContains Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sebastian Holtermann <sebholt@web.de> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Merge-request: !3700
| * | | cmAlgorithms: Add cmContainsRegina Pfeifer2019-08-191-7/+2
| | | | | | | | | | | | | | | | Also, use the new function where applicable.
* | | | Source sweep: Use cmIsOn instead of cmSystemTools::IsOnSebastian Holtermann2019-08-171-3/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | This replaces invocations of - `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn` - `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND` - `cmSystemTools::IsOn` with `cmIsOn` - `cmSystemTools::IsOff` with `cmIsOff`
* | | CUDA: Compilers can now state they don't require a device linking stepRobert Maynard2019-08-061-0/+5
| | |
* | | cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-1/+1
| | | | | | | | | | | | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* | | Merge topic 'cuda-imported-library-device-linking'Brad King2019-07-101-6/+11
|\ \ \ | |/ / |/| / | |/ | | | | | | 8895449648 CUDA: Restore device linking to imported static library targets Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3526
| * CUDA: Restore device linking to imported static library targetsRobert Maynard2019-07-091-6/+11
| | | | | | | | | | | | | | This ability was lost in commit 81b4d10d8f (CUDA: More exhaustive checks to determine when to do device linking, 2019-05-09, v3.15.0-rc1~82^2) and needs to be restored to use imported static libraries that have CUDA symbols.
* | CUDA: Do not device link if CUDA is not an enabled languageRobert Maynard2019-07-011-0/+4
|/ | | | | | | | | | | | | Checks added in commit 81b4d10d8f (CUDA: More exhaustive checks to determine when to do device linking, 2019-05-09, v3.15.0-rc1~82^2) assumed that CUDA properties would be set only if CUDA is enabled. We cannot do a device link step if we do not have the CUDA language enabled. This was discovered as some projects unconditionally set CUDA properties such as `CUDA_RESOLVE_DEVICE_SYMBOLS` even when the CUDA language has not been enabled. Fixes: #19432
* CUDA: More exhaustive checks to determine when to do device linkingRobert Maynard2019-05-211-11/+86
| | | | | | | | | Previously CMake used fairly naive logic to determine when to do device linking which caused unnecessary device linking to occur frequently. We now use a more exhaustive algorithm to determine when we have a need for device linking. Fixes: #19238
* cmNinjaLinkLineDeviceComputer now lives in the correct source fileRobert Maynard2019-05-201-15/+0
|
* CUDA: Filter out -framework arguments during device linkingRobert Maynard2019-02-281-0/+12
| | | | | | | | | The filter in commit e768d96c74 (CUDA: Filter out host link flags during device linking, 2018-10-22, v3.13.0-rc2~4^2~2^2) removes `-framework` but not the framework name that comes after it. Revise the logic to remove both. Fixes: #18911
* clang-tidy: Use `= default`Regina Pfeifer2019-01-251-3/+1
| | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* CUDA: Filter out non-static libraries during device linkingRobert Maynard2018-10-291-8/+8
| | | | | | | | | | | | Since commit v3.12.0-rc1~278^2 (CUDA: Pass more link libraries to device linking, 2018-03-27) we consider every link library during device linking and use `-Xnvlink` to pass those that do not end in `.a`. However, nvlink breaks on versioned shared library names such as `.so.1`. Work around this problem by not passing library paths that do not end in `.a` or `.lib`. nvlink would not find device symbols in them anyway. Fixes: #18504
* Merge branch 'cuda-filter-device-link-items' into cuda-thread-flagsBrad King2018-10-241-1/+18
|\
| * CUDA: Filter out host link flags during device linkingRobert Maynard2018-10-241-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Since commit v3.12.0-rc1~278^2 (CUDA: Pass more link libraries to device linking, 2018-03-27) we consider every link item during device linking. However, items that start in `-` may be host-specific link flags that nvcc will not understand during device linking. Filter such items using a white list. In particular, this allows `-pthread` to be used for host linking while not polluting the device link line. Issue: #18008
* | CUDA: Properly de-duplicate libs when doing device linkingRobert Maynard2018-07-171-5/+17
|/ | | | | | | | The nvcc device linker is designed so that each static library with device symbols only needs to be listed once as it doesn't care about link order. If you provide the same static library multiple times it will error out. To make sure this occurs we find the unique set of link items.
* CUDA: Pass more link libraries to device linkingRobert Maynard2018-03-281-30/+24
| | | | | | | | | | | | | | | | | Previously we dropped non-target items from the device link line because nvcc rejects paths to shared library files, and only with target items do we know the kind of library. However, this also prevents projects from linking to system-provided libraries like `cublas_device` that contain device code. Fix this by passing more link items to device linking. Items that are not file paths, such as `-lfoo`, can simply be passed unconditionally. Items that are targets known to be shared libraries can still be skipped. Items that are paths to library files can be passed directly if they end in `.a`. Otherwise, pass them using `-Xnvlink` to bypass nvcc's front-end. The nvlink tool knows to ignore shared library files. Issue: #16317
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-10/+8
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-3/+2
|
* CUDA: Static libraries can now explicitly resolve device symbolsRobert Maynard2017-04-261-3/+18
| | | | | | | If a static library has the property CUDA_RESOLVE_DEVICE_SYMBOLS enabled it will now perform the device link step. The normal behavior is to delay calling device link until the static library is consumed by a shared library or an executable.
* fix some include-what-you-use diagnosticsDaniel Pfeifer2017-02-171-1/+9
|
* CUDA: Now pass correct FLAGS when device link cuda executables.Robert Maynard2017-01-121-0/+6
| | | | | | | | Previously we had a two issues when building cuda executables that required separable compilation. The first was that we didn't propagate FLAGS causing any -arch / -gencode flags to be dropped, and secondly generators such as ninja would use the CXX language flags instead of CUDA when the executable was mixed language.
* CUDA: Add LinkLineComputer that computes cuda dlink lines.Robert Maynard2016-11-141-0/+74