mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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.
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user