Skip to content

Commit 8e0d40a

Browse files
committed
Fix linux compilation with swift parser
Also, removed indexing of patches, can be introduced only for those patches that are sequential.
1 parent cf1b1ff commit 8e0d40a

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake
2+
index 58c7eb1bd4f..7d321882e8d 100644
3+
--- a/cmake/modules/AddSwift.cmake
4+
+++ b/cmake/modules/AddSwift.cmake
5+
@@ -922,7 +922,7 @@ function(add_swift_host_tool executable)
6+
set_property(
7+
TARGET ${executable}
8+
APPEND PROPERTY INSTALL_RPATH
9+
- "@executable_path/../${extra_relative_rpath}lib/swift/host")
10+
+ "$ORIGIN/../${extra_relative_rpath}lib/swift/host")
11+
endif()
12+
13+
if(ASHT_THINLTO_LD64_ADD_FLTO_CODEGEN_ONLY)
14+
diff --git a/lib/ASTGen/CMakeLists.txt b/lib/ASTGen/CMakeLists.txt
15+
index c7334a6da0b..2a0cb80b743 100644
16+
--- a/lib/ASTGen/CMakeLists.txt
17+
+++ b/lib/ASTGen/CMakeLists.txt
18+
@@ -1,4 +1,11 @@
19+
if (SWIFT_SWIFT_PARSER)
20+
+ if (SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX")
21+
+ # including libdispatch leads to multiple module definition problems, as it seems
22+
+ # it is already available to the swift toolchain
23+
+ get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
24+
+ list(REMOVE_ITEM dirs "${SWIFT_PATH_TO_LIBDISPATCH_SOURCE}")
25+
+ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES "${dirs}")
26+
+ endif()
27+
# Ensure that we do not link the _StringProcessing module. But we can
28+
# only pass this flag for new-enough compilers that support it.
29+
file(WRITE "${CMAKE_BINARY_DIR}/tmp/empty-check-string-processing.swift" "")

0 commit comments

Comments
 (0)