Skip to content

Commit 64c5430

Browse files
committed
[CMake] Further cleanup for RUNPATH setting
`$ORIGIN` is only supported in Linux, BSD, etc. (i.e. not in Windows) (cherry picked from commit 602604b)
1 parent 42360db commit 64c5430

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,15 @@ function(add_sourcekit_swift_runtime_link_flags target path HAS_SWIFT_MODULES)
151151
else()
152152
message(FATAL_ERROR "Unknown ASKD_BOOTSTRAPPING_MODE '${ASKD_BOOTSTRAPPING_MODE}'")
153153
endif()
154-
endif()
155-
156-
if(SWIFT_SWIFT_PARSER)
157-
# Add rpath to the host Swift libraries.
158-
if (NOT SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS)
159-
file(RELATIVE_PATH relative_hostlib_path "${path}" "${SWIFTLIB_DIR}/host")
160-
list(APPEND RPATH_LIST "$ORIGIN/${relative_hostlib_path}")
161-
endif()
162154

163-
# Add rpath to the host Swift libraries.
164-
if (NOT ${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS)
155+
if(SWIFT_SWIFT_PARSER)
156+
# Add rpath to the host Swift libraries.
165157
file(RELATIVE_PATH relative_hostlib_path "${path}" "${SWIFTLIB_DIR}/host")
166158
list(APPEND RPATH_LIST "$ORIGIN/${relative_hostlib_path}")
167159
endif()
160+
endif()
168161

162+
if(SWIFT_SWIFT_PARSER)
169163
# For the "end step" of bootstrapping configurations on Darwin, need to be
170164
# able to fall back to the SDK directory for libswiftCore et al.
171165
if (BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*")

0 commit comments

Comments
 (0)