Skip to content

Commit a5705d6

Browse files
committed
build: add a workaround for reflection test on Windows
Copy the runtime component into the swift runtime directory. Normally the runtime directory is not the same as the library directory on Windows. This copies the runtime component into the build tree into the runtime directory to permit the tests to find the standard library.
1 parent 92fe204 commit a5705d6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,11 @@ function(_add_swift_library_single target name)
10271027
set_target_properties("${target}" PROPERTIES
10281028
LIBRARY_OUTPUT_DIRECTORY ${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}
10291029
ARCHIVE_OUTPUT_DIRECTORY ${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR})
1030+
if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND SWIFTLIB_SINGLE_IS_STDLIB_CORE
1031+
AND libkind STREQUAL SHARED)
1032+
add_custom_command(TARGET ${target} POST_BUILD
1033+
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${target}> ${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR})
1034+
endif()
10301035

10311036
foreach(config ${CMAKE_CONFIGURATION_TYPES})
10321037
string(TOUPPER ${config} config_upper)

0 commit comments

Comments
 (0)