@@ -191,7 +191,7 @@ function(add_properties_for_swift_modules target reldir)
191
191
endif ()
192
192
193
193
if (NOT BOOTSTRAPPING_MODE)
194
- if (SWIFT_SWIFT_PARSER )
194
+ if (SWIFT_BUILD_SWIFT_SYNTAX )
195
195
set (APSM_BOOTSTRAPPING_MODE "HOSTTOOLS" )
196
196
endif ()
197
197
else ()
@@ -217,18 +217,28 @@ function(add_properties_for_swift_modules target reldir)
217
217
# Workaround for a linker crash related to autolinking: rdar://77839981
218
218
set_property (TARGET ${target} APPEND_STRING PROPERTY
219
219
LINK_FLAGS " -lobjc " )
220
+
221
+ set_property (TARGET ${target} APPEND PROPERTY BUILD_RPATH "${SWIFT_BUILD_RPATH} " )
222
+ set_property (TARGET ${target} APPEND PROPERTY INSTALL_RPATH "${SWIFT_INSTALL_RPATH} " )
220
223
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android|OpenBSD|FreeBSD" )
221
224
string (REGEX MATCH "^[^-]*" arch ${LLVM_TARGET_TRIPLE} )
222
225
target_link_libraries (${target} PRIVATE swiftCore-linux-${arch} )
223
226
string (TOLOWER ${CMAKE_SYSTEM_NAME} platform)
224
227
set (SWIFT_BUILD_RPATH "${LLDB_SWIFT_LIBS} /${platform} " )
225
228
set (SWIFT_INSTALL_RPATH "$ORIGIN/${reldir} lib/swift/${platform} " )
229
+ set_property (TARGET ${target} APPEND PROPERTY BUILD_RPATH "${SWIFT_BUILD_RPATH} " )
230
+ set_property (TARGET ${target} APPEND PROPERTY INSTALL_RPATH "${SWIFT_INSTALL_RPATH} " )
231
+ elseif (CMAKE_SYSTEM_NAME MATCHES Windows)
232
+ if (CMAKE_SYSTEM_PROCESSOR MATCHES AMD64|amd64|x86_64)
233
+ target_link_directories (${target} PRIVATE
234
+ ${SWIFT_PATH_TO_SWIFT_SDK} /usr/lib/swift/windows/x86_64)
235
+ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES ARM64|arm64|aarch64)
236
+ target_link_directories (${target} PRIVATE
237
+ ${SWIFT_PATH_TO_SWIFT_SDK} /usr/lib/swift/windows/aarch64)
238
+ endif ()
226
239
endif ()
227
240
228
- set_property (TARGET ${target} APPEND PROPERTY BUILD_RPATH "${SWIFT_BUILD_RPATH} " )
229
- set_property (TARGET ${target} APPEND PROPERTY INSTALL_RPATH "${SWIFT_INSTALL_RPATH} " )
230
-
231
- if (SWIFT_SWIFT_PARSER)
241
+ if (SWIFT_BUILD_SWIFT_SYNTAX)
232
242
if (CMAKE_SYSTEM_NAME MATCHES "Darwin" )
233
243
set_property (TARGET ${target}
234
244
APPEND PROPERTY BUILD_RPATH "@loader_path/${build_reldir} lib/swift/host" )
0 commit comments