summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Mylonopoulos <32958057+ramenguy99@users.noreply.github.com>2025-09-25 13:12:26 +0200
committerGitHub <noreply@github.com>2025-09-25 11:12:26 +0000
commit2e0fe3d0608c4de239fd6cd2ecdf0322951855f5 (patch)
treeaf3f1256a5734b056d716e5920b47c49f48a3328
parent55183716f2c8db506acd2f01330e6e21e3d9fdc7 (diff)
Fix CMake error with generator on list in 3.22.1 (#8364)
Fixes #8335 --------- Co-authored-by: Mukund Keshava <mkeshava@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
-rw-r--r--cmake/SlangTarget.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmake/SlangTarget.cmake b/cmake/SlangTarget.cmake
index 882e86f71..6e2fc97b1 100644
--- a/cmake/SlangTarget.cmake
+++ b/cmake/SlangTarget.cmake
@@ -420,10 +420,11 @@ function(slang_add_target dir type)
PRIVATE $<BUILD_LOCAL_INTERFACE:${ARG_LINK_WITH_PRIVATE}>
)
else()
- target_link_libraries(
- ${target}
- PRIVATE $<BUILD_INTERFACE:${ARG_LINK_WITH_PRIVATE}>
- )
+ # Expand the list manually to work around a bug in cmake 3.22.1
+ # See: https://github.com/shader-slang/slang/issues/8335
+ foreach(lib IN LISTS ARG_LINK_WITH_PRIVATE)
+ target_link_libraries(${target} PRIVATE $<BUILD_INTERFACE:${lib}>)
+ endforeach()
endif()
target_link_libraries(${target} PUBLIC ${ARG_LINK_WITH_PUBLIC})