Skip to content

Commit 2c26aa5

Browse files
committed
tentative fix for linux build
1 parent f204b21 commit 2c26aa5

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

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

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
11
diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake
2-
index 58c7eb1bd4f..da56fbb1c20 100644
2+
index 58c7eb1bd4f..4f4d5b7edea 100644
33
--- a/cmake/modules/AddSwift.cmake
44
+++ b/cmake/modules/AddSwift.cmake
5-
@@ -918,11 +918,17 @@ function(add_swift_host_tool executable)
6-
set(extra_relative_rpath "../")
5+
@@ -912,17 +912,22 @@ function(add_swift_host_tool executable)
6+
endif()
7+
8+
if(SWIFT_SWIFT_PARSER)
9+
- set(extra_relative_rpath "")
10+
- if(NOT ${ASHT_BOOTSTRAPPING} STREQUAL "")
11+
- if (${executable} MATCHES "-bootstrapping")
12+
- set(extra_relative_rpath "../")
13+
+ if (SWIFT_HOST_VARIANT_SDK STREQUAL LINUX)
14+
+ if(NOT ${ASHT_BOOTSTRAPPING} STREQUAL "" AND ${executable} MATCHES "-bootstrapping")
15+
+ set_property(TARGET ${executable} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../../lib/swift/host")
16+
+ else()
17+
+ set_property(TARGET ${executable} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../lib/swift/host")
18+
+ endif()
19+
+ else()
20+
+ set(extra_relative_rpath "")
21+
+ if(NOT ${ASHT_BOOTSTRAPPING} STREQUAL "" AND ${executable} MATCHES "-bootstrapping")
22+
+ set(extra_relative_rpath "../")
723
endif()
24+
+ set_property(
25+
+ TARGET ${executable}
26+
+ APPEND PROPERTY INSTALL_RPATH
27+
+ "@executable_path/../${extra_relative_rpath}lib/swift/host")
828
endif()
929
-
1030
- set_property(
1131
- TARGET ${executable}
1232
- APPEND PROPERTY INSTALL_RPATH
1333
- "@executable_path/../${extra_relative_rpath}lib/swift/host")
14-
+ if (SWIFT_HOST_VARIANT_SDK STREQUAL LINUX)
15-
+ set_property(
16-
+ TARGET ${executable}
17-
+ APPEND PROPERTY INSTALL_RPATH
18-
+ "$ORIGIN/../${extra_relative_rpath}lib/swift/host")
19-
+ else()
20-
+ set_property(
21-
+ TARGET ${executable}
22-
+ APPEND PROPERTY INSTALL_RPATH
23-
+ "@executable_path/../${extra_relative_rpath}lib/swift/host")
24-
+ endif()
2534
endif()
2635

2736
if(ASHT_THINLTO_LD64_ADD_FLTO_CODEGEN_ONLY)

0 commit comments

Comments
 (0)