From 7c63372c22a4e3b1a93092584d25f830d1014ba2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 2 Dec 2022 10:48:17 -0500 Subject: cmGeneratorTarget: Fix regression in CUDA device link options Since commit f69d1872db (cmGeneratorTarget: Add caches to some functions, 2022-11-23) we cache the computed link options for a target. Cache the host and device link options separately. --- Source/cmGeneratorTarget.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 5ac4dd5..ab746f8 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -4651,7 +4651,8 @@ void cmGeneratorTarget::GetLinkOptions(std::vector& result, std::vector> cmGeneratorTarget::GetLinkOptions( std::string const& config, std::string const& language) const { - ConfigAndLanguage cacheKey(config, language); + ConfigAndLanguage cacheKey( + config, cmStrCat(language, this->IsDeviceLink() ? "-device" : "")); { auto it = this->LinkOptionsCache.find(cacheKey); if (it != this->LinkOptionsCache.end()) { @@ -4937,7 +4938,8 @@ void cmGeneratorTarget::GetLinkDirectories(std::vector& result, std::vector> cmGeneratorTarget::GetLinkDirectories( std::string const& config, std::string const& language) const { - ConfigAndLanguage cacheKey(config, language); + ConfigAndLanguage cacheKey( + config, cmStrCat(language, this->IsDeviceLink() ? "-device" : "")); { auto it = this->LinkDirectoriesCache.find(cacheKey); if (it != this->LinkDirectoriesCache.end()) { -- cgit v0.12