Skip to content

Commit c24db4f

Browse files
committed
Fix rpath on macOS
1 parent 6562df3 commit c24db4f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

patches/swift/fix-linux-compilation-with-swift-parser.patch

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake
2-
index 58c7eb1bd4f..7d321882e8d 100644
2+
index 58c7eb1bd4f..97f72f6eece 100644
33
--- a/cmake/modules/AddSwift.cmake
44
+++ b/cmake/modules/AddSwift.cmake
5-
@@ -922,7 +922,7 @@ function(add_swift_host_tool executable)
5+
@@ -918,11 +918,15 @@ function(add_swift_host_tool executable)
6+
set(extra_relative_rpath "../")
7+
endif()
8+
endif()
9+
-
10+
+ if (SWIFT_HOST_VARIANT_SDK STREQUAL LINUX)
11+
+ set(origin "$ORIGIN")
12+
+ else()
13+
+ set(origin "@executable_path")
14+
+ endif()
615
set_property(
716
TARGET ${executable}
817
APPEND PROPERTY INSTALL_RPATH
918
- "@executable_path/../${extra_relative_rpath}lib/swift/host")
10-
+ "$ORIGIN/../${extra_relative_rpath}lib/swift/host")
19+
+ "${origin}/../${extra_relative_rpath}lib/swift/host")
1120
endif()
1221

1322
if(ASHT_THINLTO_LD64_ADD_FLTO_CODEGEN_ONLY)

0 commit comments

Comments
 (0)