From 2e0fe3d0608c4de239fd6cd2ecdf0322951855f5 Mon Sep 17 00:00:00 2001 From: Dario Mylonopoulos <32958057+ramenguy99@users.noreply.github.com> Date: Thu, 25 Sep 2025 13:12:26 +0200 Subject: Fix CMake error with generator on list in 3.22.1 (#8364) Fixes #8335 --------- Co-authored-by: Mukund Keshava Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Ellie Hermaszewska --- cmake/SlangTarget.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cmake') 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 $ ) else() - target_link_libraries( - ${target} - 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 $) + endforeach() endif() target_link_libraries(${target} PUBLIC ${ARG_LINK_WITH_PUBLIC}) -- cgit v1.2.3