Skip to content

Commit 2e0fe3d

Browse files
ramenguy99mkeshavaNVslangbotexpipiplus1
authored
Fix CMake error with generator on list in 3.22.1 (#8364)
Fixes #8335 --------- Co-authored-by: Mukund Keshava <[email protected]> Co-authored-by: slangbot <[email protected]> Co-authored-by: Ellie Hermaszewska <[email protected]>
1 parent 5518371 commit 2e0fe3d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cmake/SlangTarget.cmake

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,11 @@ function(slang_add_target dir type)
420420
PRIVATE $<BUILD_LOCAL_INTERFACE:${ARG_LINK_WITH_PRIVATE}>
421421
)
422422
else()
423-
target_link_libraries(
424-
${target}
425-
PRIVATE $<BUILD_INTERFACE:${ARG_LINK_WITH_PRIVATE}>
426-
)
423+
# Expand the list manually to work around a bug in cmake 3.22.1
424+
# See: https://github.com/shader-slang/slang/issues/8335
425+
foreach(lib IN LISTS ARG_LINK_WITH_PRIVATE)
426+
target_link_libraries(${target} PRIVATE $<BUILD_INTERFACE:${lib}>)
427+
endforeach()
427428
endif()
428429

429430
target_link_libraries(${target} PUBLIC ${ARG_LINK_WITH_PUBLIC})

0 commit comments

Comments
 (0)