diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2023-09-22 15:13:13 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2023-09-25 12:50:38 (GMT) |
commit | cd984261e1c2f27c2c716d43f3502c829990685d (patch) | |
tree | 13dedd279f06ce57d8ec824ef26c7479137b7120 /Source/cmLinkLineDeviceComputer.cxx | |
parent | aa8facefe8a451918f9be143c2adc1fffe162c4a (diff) | |
download | CMake-cd984261e1c2f27c2c716d43f3502c829990685d.zip CMake-cd984261e1c2f27c2c716d43f3502c829990685d.tar.gz CMake-cd984261e1c2f27c2c716d43f3502c829990685d.tar.bz2 |
CUDA: Device linking now uses TARGET_OBJECTS content
Due to an oversight in cmLinkLineDeviceComputer object
files did not get propagate to the device linking phase
when given via the `$<TARGET_OBJECTS>` generator expression.
Diffstat (limited to 'Source/cmLinkLineDeviceComputer.cxx')
-rw-r--r-- | Source/cmLinkLineDeviceComputer.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx index ded6466..28aa5d9 100644 --- a/Source/cmLinkLineDeviceComputer.cxx +++ b/Source/cmLinkLineDeviceComputer.cxx @@ -101,9 +101,7 @@ void cmLinkLineDeviceComputer::ComputeLinkLibraries( ItemVector const& items = cli.GetItems(); std::string config = cli.GetConfig(); bool skipItemAfterFramework = false; - // Note: - // Any modification of this algorithm should be reflected also in - // cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions + for (auto const& item : items) { if (skipItemAfterFramework) { skipItemAfterFramework = false; @@ -132,11 +130,13 @@ void cmLinkLineDeviceComputer::ComputeLinkLibraries( BT<std::string> linkLib; if (item.IsPath == cmComputeLinkInformation::ItemIsPath::Yes) { - // nvcc understands absolute paths to libraries ending in '.a' or '.lib'. - // These should be passed to nvlink. Other extensions need to be left - // out because nvlink may not understand or need them. Even though it - // can tolerate '.so' or '.dylib' it cannot tolerate '.so.1'. - if (cmHasLiteralSuffix(item.Value.Value, ".a") || + // nvcc understands absolute paths to libraries ending in '.o', .a', or + // '.lib'. These should be passed to nvlink. Other extensions need to be + // left out because nvlink may not understand or need them. Even though + // it can tolerate '.so' or '.dylib' it cannot tolerate '.so.1'. + if (cmHasLiteralSuffix(item.Value.Value, ".o") || + cmHasLiteralSuffix(item.Value.Value, ".obj") || + cmHasLiteralSuffix(item.Value.Value, ".a") || cmHasLiteralSuffix(item.Value.Value, ".lib")) { linkLib.Value = item .GetFormattedItem(this->ConvertToOutputFormat( |