Skip to content

Commit 15141bc

Browse files
committed
build: quote library search path options
When passing the linker search path options to the driver, ensure that we quote the argument. We would previously incorrectly split the arguments that were passed to the driver if there were spaces. This would manifest as link failures on Linux when cross-compiling to Windows.
1 parent 62c9a3d commit 15141bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ endfunction()
497497
function(swift_target_link_search_directories target directories)
498498
set(STLD_FLAGS "")
499499
foreach(directory ${directories})
500-
set(STLD_FLAGS "${STLD_FLAGS} ${CMAKE_LIBRARY_PATH_FLAG}${directory}")
500+
set(STLD_FLAGS "${STLD_FLAGS} \"${CMAKE_LIBRARY_PATH_FLAG}${directory}\"")
501501
endforeach()
502502
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS ${STLD_FLAGS})
503503
endfunction()

0 commit comments

Comments
 (0)