Skip to content

Commit 818419c

Browse files
author
Alex Denisov
committed
Swift 5.7
1 parent 4bd0eca commit 818419c

File tree

2 files changed

+7
-31
lines changed

2 files changed

+7
-31
lines changed

swift-build-presets

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
release
33
build-subdir=codeql
44

5+
bootstrapping=off
56
llvm-targets-to-build=X86;ARM;AArch64
67
llvm-cmake-options=-DLLVM_ENABLE_TERMINFO=OFF
78

@@ -33,6 +34,7 @@ debug
3334
assertions
3435
build-subdir=codeql-debug
3536

37+
bootstrapping=off
3638
llvm-targets-to-build=X86;ARM;AArch64
3739
llvm-cmake-options=-DLLVM_ENABLE_TERMINFO=OFF
3840

swift-build-system.patch

+5-31
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
2-
index 8046ea79966..4c2c040a573 100644
2+
index 8046ea79966..cd4fa6e673b 100644
33
--- a/cmake/modules/CMakeLists.txt
44
+++ b/cmake/modules/CMakeLists.txt
5-
@@ -17,3 +17,55 @@ configure_file(
5+
@@ -17,3 +17,54 @@ configure_file(
66
SwiftConfig.cmake.in
77
${swift_cmake_builddir}/SwiftConfig.cmake
88
@ONLY)
99
+
10-
+
1110
+# Generate install-tree CMake files
1211
+set(SWIFT_CONFIG_CODE "
13-
+# Compute the installation prefix from this LLVMConfig.cmake file location.
12+
+# Compute the installation prefix from this SwiftConfig.cmake file location.
1413
+get_filename_component(SWIFT_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
1514
+# Construct the proper number of get_filename_component(... PATH)
1615
+# calls to compute the installation prefix.
@@ -59,10 +58,10 @@ index 8046ea79966..4c2c040a573 100644
5958
+install(DIRECTORY ${CMAKE_SOURCE_DIR}/stdlib/public/SwiftShims DESTINATION stdlib/public)
6059
+
6160
diff --git a/cmake/modules/SwiftComponents.cmake b/cmake/modules/SwiftComponents.cmake
62-
index d7a03ae74ed..5506512d77f 100644
61+
index 4d77e374deb..88b6645a811 100644
6362
--- a/cmake/modules/SwiftComponents.cmake
6463
+++ b/cmake/modules/SwiftComponents.cmake
65-
@@ -74,7 +74,7 @@ set(_SWIFT_DEFINED_COMPONENTS
64+
@@ -76,7 +76,7 @@ set(_SWIFT_DEFINED_COMPONENTS
6665
# for the following exceptions.
6766
set(_SWIFT_DEFAULT_COMPONENTS "${_SWIFT_DEFINED_COMPONENTS}")
6867
# 'dev' takes up a lot of disk space and isn't part of a normal toolchain.
@@ -71,28 +70,3 @@ index d7a03ae74ed..5506512d77f 100644
7170
# These clang header options conflict with 'clang-builtin-headers'.
7271
list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "clang-resource-dir-symlink")
7372
list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "clang-builtin-headers-in-clang-resource-dir")
74-
diff --git a/cmake/modules/SwiftSharedCMakeConfig.cmake b/cmake/modules/SwiftSharedCMakeConfig.cmake
75-
index 26ada5dc9ac..f5e98328616 100644
76-
--- a/cmake/modules/SwiftSharedCMakeConfig.cmake
77-
+++ b/cmake/modules/SwiftSharedCMakeConfig.cmake
78-
@@ -14,6 +14,20 @@ macro(swift_common_standalone_build_config_llvm product)
79-
# Then we import LLVMConfig. This is going to override whatever cached value
80-
# we have for LLVM_ENABLE_ASSERTIONS.
81-
find_package(LLVM CONFIG REQUIRED NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
82-
+ if (APPLE)
83-
+ if (LLVM_VERSION_MAJOR GREATER_EQUAL 12)
84-
+ # Precompiled LLVM 12+ on macOS contains a hardcoded dependency on a very
85-
+ # specific version of libcurses:
86-
+ #
87-
+ # set_target_properties(LLVMSupport PROPERTIES
88-
+ # INTERFACE_LINK_LIBRARIES "m;ZLIB::ZLIB;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/lib/libcurses.tbd;LLVMDemangle"
89-
+ # )
90-
+ #
91-
+ # So we are monkey-patching it here
92-
+ set_target_properties(LLVMSupport PROPERTIES
93-
+ INTERFACE_LINK_LIBRARIES "z;curses;m;LLVMDemangle")
94-
+ endif()
95-
+ endif()
96-
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
97-
98-
set(LLVM_MAIN_SRC_DIR "${LLVM_BUILD_MAIN_SRC_DIR}"

0 commit comments

Comments
 (0)