bump(swift): 5.9 to 5.9.1

This commit is contained in:
Finagolfin 2023-10-19 12:27:03 +05:30 committed by finagolfin
parent be9a81ad2d
commit 8a2c5a18d2
8 changed files with 189 additions and 145 deletions

View File

@ -2,10 +2,10 @@ TERMUX_PKG_HOMEPAGE=https://swift.org/
TERMUX_PKG_DESCRIPTION="Swift is a high-performance system programming language"
TERMUX_PKG_LICENSE="Apache-2.0, NCSA"
TERMUX_PKG_MAINTAINER="@finagolfin"
TERMUX_PKG_VERSION=5.9
TERMUX_PKG_VERSION=5.9.1
SWIFT_RELEASE="RELEASE"
TERMUX_PKG_SRCURL=https://github.com/apple/swift/archive/swift-$TERMUX_PKG_VERSION-$SWIFT_RELEASE.tar.gz
TERMUX_PKG_SHA256=2f57327bfab410b3d1e0aff36ece0b9768c5813004d96e9e0f0c1bd0342c4f73
TERMUX_PKG_SHA256=d63c9743fa1d35c8c6203745955375fd69c710897de96d1c6245d2c9e42fbb49
TERMUX_PKG_AUTO_UPDATE=false
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_DEPENDS="clang, libandroid-glob, libandroid-posix-semaphore, libandroid-spawn, libcurl, libicu, libicu-static, libsqlite, libuuid, libxml2, libdispatch, llbuild, pkg-config, swift-sdk-${TERMUX_ARCH/_/-}"
@ -35,14 +35,14 @@ termux_step_post_get_source() {
mv .temp swift
declare -A library_checksums
library_checksums[swift-cmark]=1cd65148e5cbaa097e43709eaac8c4632e1c7cf83b1cd5031ef5dc8d4202a7d5
library_checksums[llvm-project]=80b0b2178efbef4be4ece9e428b7a7f02f8cafc879f886d8602c77f3b54703c4
library_checksums[swift-experimental-string-processing]=fcd8c52d1fbeded100fe88747bfd0578293133678d04beedec2a9f28aa1ec0a9
library_checksums[swift-syntax]=c7a693e917d21f6fa816f0bbb054468fb93d6c37dda9110669026f1203e6dbe5
library_checksums[swift-corelibs-libdispatch]=db30ccf6b20963112ab3aad256c2e49a18041a9806cf2f05854fe63a90d688c2
library_checksums[swift-corelibs-foundation]=24779a0f4e9ad545fbd59aaeb191c10ecc36b71c46394cf56ca5e6096ef89627
library_checksums[swift-corelibs-xctest]=f70044d3522d8d45d6a8bba6522987765a7de5dcbe8b11f12acc8600042a9c52
library_checksums[swift-llbuild]=cc8dfb098db4b0210ca5466f59d3e5fc55c4eedcd835263e6eae7dd719ba8203
library_checksums[swift-cmark]=33dde8fc9e02a882d2adc79f1b7b77ae6397a66c73262bbdc3b49c53ab823b01
library_checksums[llvm-project]=3cd34ef37dd74a6d4d93be20fb251658e9a1e3c19aeeefd81c027023c485e286
library_checksums[swift-experimental-string-processing]=a01b2f895d49c23a4d322bfd486d4a7dcfeb96760d9c17f2e48b93428220b9ee
library_checksums[swift-syntax]=b2ab10adcfbaebdd56954f724856d6ddd327422b4109d49ec5fb96b92b078003
library_checksums[swift-corelibs-libdispatch]=bcccde91987982dca285a5c73efa0922135b6caca07bc9e5a33333b0aa869db2
library_checksums[swift-corelibs-foundation]=9835efe51b78c329042e32b2b1bd82a0816535ca08687a30c0787091cdd40884
library_checksums[swift-corelibs-xctest]=8d4cbffba2f828033a0074682d1bedd7a55d6410b6a30ca1e7c69917ab9352fe
library_checksums[swift-llbuild]=eeff879bc19de21aed72a747602212dff8ffe25833880c466a44087ffe2ed1ac
library_checksums[swift-argument-parser]=44782ba7180f924f72661b8f457c268929ccd20441eac17301f18eff3b91ce0c
library_checksums[Yams]=ec1ad699c30f0db45520006c63a88cc1c946a7d7b36dff32a96460388c0a4af2
library_checksums[swift-collections]=575cf0f88d9068411f9acc6e3ca5d542bef1cc9e87dc5d69f7b5a1d5aec8c6b6
@ -50,11 +50,11 @@ termux_step_post_get_source() {
library_checksums[swift-system]=865b8c380455eef27e73109835142920c60ae4c4f4178a3d12ad04acc83f1371
library_checksums[swift-asn1]=d4470d61788194abbd60ed73965ee0722cc25037e83d41226a8a780088ba524e
library_checksums[swift-certificates]=d7699ce91d65a622c1b9aaa0235cbbbd1be4ddc42a90fce007ff74bef50e8985
library_checksums[swift-driver]=e51199f694a2e2bc10e153acb3f8af94531d877e1db8bd483a9258cf6d3540dc
library_checksums[swift-tools-support-core]=dc84bfc05239ae863d82651637afb0551c6340a06dcb60f6fec685fefbab9077
library_checksums[swift-package-manager]=f9a589ee585b40405edb7944ed57effda62abbbae83989c7bf485ecdd4dfae16
library_checksums[indexstore-db]=dc50698dd5b226b15678ec35d662cbe54c69e1a4e492f14d673cb17cee0bed82
library_checksums[sourcekit-lsp]=eff0ae4a428a178aa32c6659f9eb9ad6a9b13be4c0cfd164588f70f268d5d6cd
library_checksums[swift-driver]=4fc7965cd477daf61ff2d5b555007a195dc601e9864ee6d494826a7aa7ff31c7
library_checksums[swift-tools-support-core]=e261dfdfc964a770c545c66267108c77692d06977c0d0bb437498f79ec23365c
library_checksums[swift-package-manager]=8e08b39fd7eb5329539514358d470bd84218a8b4ce53962d7fe3797f51adf59b
library_checksums[indexstore-db]=0789b254455e6f216b8d907ebc8fe5927106ae3a7a099d6478bbb9e6fac9b9fb
library_checksums[sourcekit-lsp]=0fd130c814a35b3ba2b6b6d01979923fd57b3f453d154860ec2f53f9ade38023
for library in "${!library_checksums[@]}"; do \
GH_ORG="apple"

View File

@ -121,9 +121,9 @@ index a448bcb23c4..0ddbac17a52 100644
get_filename_component(swift_dir ${swift_bin_dir} DIRECTORY)
- set(host_lib_dir "${swift_dir}/lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
+ set(host_lib_dir "${SWIFT_BINARY_DIR}/lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
set(swiftrt "${host_lib_dir}/${SWIFT_HOST_VARIANT_ARCH}/swiftrt.o")
target_link_libraries(${target} PRIVATE ${swiftrt})
target_link_libraries(${target} PRIVATE "swiftCore")
diff --git a/swift/localization/CMakeLists.txt b/swift/localization/CMakeLists.txt
index 07a3585a66c..461a98b6856 100644
--- a/swift/localization/CMakeLists.txt

View File

@ -222,7 +222,7 @@ index 5b935d4cebb..2f7c14fd1a2 100644
@@ -119,6 +119,15 @@ void SwiftDiagnostic_finish(BridgedDiagnostic diagPtr) {
BridgedIdentifier
SwiftASTContext_getIdentifier(void *ctx, const unsigned char *_Nullable str,
long len) {
SwiftInt len) {
+ if (len == 1 && str[0] == '_')
+ return BridgedIdentifier();
+

View File

@ -11,8 +11,8 @@ index 9647ddf561f14..4f181c1d1f916 100644
--- a/swift/include/swift/AST/CASTBridging.h
+++ b/swift/include/swift/AST/CASTBridging.h
@@ -42,27 +42,46 @@ SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
typedef long SwiftInt;
typedef unsigned long SwiftUInt;
SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
+typedef struct {
+ const unsigned char *_Nullable data;
@ -21,7 +21,7 @@ index 9647ddf561f14..4f181c1d1f916 100644
+
typedef struct {
const void *_Nullable data;
long numElements;
SwiftInt numElements;
} BridgedArrayRef;
+typedef struct BridgedASTContext {
@ -65,7 +65,7 @@ index 9647ddf561f14..4f181c1d1f916 100644
+ BridgedSourceLoc TrailingCommaLoc;
} BridgedTupleTypeElement;
typedef enum ENUM_EXTENSIBILITY_ATTR(open) BridgedRequirementReprKind : long {
typedef enum ENUM_EXTENSIBILITY_ATTR(open) BridgedRequirementReprKind : SwiftInt {
@@ -84,7 +103,7 @@ typedef enum ENUM_EXTENSIBILITY_ATTR(open) BridgedRequirementReprKind : long {
} BridgedRequirementReprKind;
@ -88,7 +88,7 @@ index 9647ddf561f14..4f181c1d1f916 100644
+ void *raw;
+} BridgedDiagnosticEngine;
typedef enum ENUM_EXTENSIBILITY_ATTR(open) BridgedMacroDefinitionKind : long {
typedef enum ENUM_EXTENSIBILITY_ATTR(open) BridgedMacroDefinitionKind : SwiftInt {
/// An expanded macro.
@@ -176,11 +200,37 @@ typedef enum ENUM_EXTENSIBILITY_ATTR(closed) BridgedTypeAttrKind : long {
BridgedTypeAttrKind_Count
@ -137,7 +137,7 @@ index 9647ddf561f14..4f181c1d1f916 100644
- BridgedDiagnosticSeverity severity,
- const void *_Nullable sourceLoc,
- const unsigned char *_Nullable text,
- long textLen);
- SwiftInt textLen);
+BridgedDiagnostic Diagnostic_create(BridgedDiagnosticEngine cDiags,
+ BridgedDiagnosticSeverity severity,
+ BridgedSourceLoc cLoc, BridgedString cText);
@ -153,7 +153,7 @@ index 9647ddf561f14..4f181c1d1f916 100644
- const void *_Nullable replaceStartLoc,
- const void *_Nullable replaceEndLoc,
- const unsigned char *_Nullable newText,
- long newTextLen);
- SwiftInt newTextLen);
+void Diagnostic_fixItReplace(BridgedDiagnostic cDiag,
+ BridgedSourceLoc cStartLoc,
+ BridgedSourceLoc cEndLoc,
@ -165,7 +165,7 @@ index 9647ddf561f14..4f181c1d1f916 100644
-BridgedIdentifier
-SwiftASTContext_getIdentifier(void *ctx, const unsigned char *_Nullable str,
- long len);
- SwiftInt len);
+BridgedIdentifier ASTContext_getIdentifier(BridgedASTContext cContext,
+ BridgedString cStr);
@ -214,13 +214,13 @@ index 9647ddf561f14..4f181c1d1f916 100644
-void *SwiftStringLiteralExpr_create(void *ctx,
- const unsigned char *_Nullable string,
- long len, void *TokenLoc);
- SwiftInt len, void *TokenLoc);
+void *StringLiteralExpr_create(BridgedASTContext cContext, BridgedString cStr,
+ BridgedSourceLoc cTokenLoc);
-void *SwiftIntegerLiteralExpr_create(void *ctx,
- const unsigned char *_Nullable string,
- long len, void *TokenLoc);
- SwiftInt len, void *TokenLoc);
+void *IntegerLiteralExpr_create(BridgedASTContext cContext, BridgedString cStr,
+ BridgedSourceLoc cTokenLoc);
@ -250,7 +250,7 @@ index 9647ddf561f14..4f181c1d1f916 100644
-void *IfStmt_create(void *ctx, void *ifLoc, void *cond, void *_Nullable then,
- void *_Nullable elseLoc, void *_Nullable elseStmt);
-
-typedef enum ENUM_EXTENSIBILITY_ATTR(open) ASTNodeKind : long {
-typedef enum ENUM_EXTENSIBILITY_ATTR(open) ASTNodeKind : SwiftInt {
- ASTNodeKindExpr,
- ASTNodeKindStmt,
- ASTNodeKindDecl
@ -270,7 +270,7 @@ index 9647ddf561f14..4f181c1d1f916 100644
- void *rbloc);
+BridgedSourceLoc SourceLoc_advanced(BridgedSourceLoc cLoc, long len);
-void *BridgedSourceLoc_advanced(void *loc, long len);
-void *BridgedSourceLoc_advanced(void *loc, SwiftInt len);
+void *ParamDecl_create(BridgedASTContext cContext, BridgedSourceLoc cLoc,
+ BridgedSourceLoc cArgLoc, BridgedIdentifier argName,
+ BridgedSourceLoc cParamLoc, BridgedIdentifier paramName,
@ -385,7 +385,7 @@ index 9647ddf561f14..4f181c1d1f916 100644
- BridgedArrayRef reqs, void *rAngleLoc);
-void *GenericTypeParamDecl_create(void *ctx, void *declContext,
- BridgedIdentifier name, void *nameLoc,
- void *_Nullable eachLoc, long index,
- void *_Nullable eachLoc, SwiftInt index,
+ BridgedSourceLoc cNameLoc,
+ BridgedDeclContext cDeclContext);
+
@ -493,7 +493,7 @@ diff --git a/swift/lib/AST/CASTBridging.cpp b/swift/lib/AST/CASTBridging.cpp
index b76dcfa8e5cc8..76b9b484e8f80 100644
--- a/swift/lib/AST/CASTBridging.cpp
+++ b/swift/lib/AST/CASTBridging.cpp
@@ -15,46 +15,91 @@
@@ -15,50 +15,91 @@
using namespace swift;
@ -548,6 +548,8 @@ index b76dcfa8e5cc8..76b9b484e8f80 100644
-namespace {
- struct BridgedDiagnosticImpl {
- typedef llvm::MallocAllocator Allocator;
-
- InFlightDiagnostic inFlight;
- std::vector<StringRef> textBlobs;
-
@ -558,8 +560,10 @@ index b76dcfa8e5cc8..76b9b484e8f80 100644
-
- ~BridgedDiagnosticImpl() {
- inFlight.flush();
-
- Allocator allocator;
- for (auto text: textBlobs) {
- free((void*)text.data());
- allocator.Deallocate(text.data(), text.size());
- }
- }
- };
@ -597,16 +601,18 @@ index b76dcfa8e5cc8..76b9b484e8f80 100644
- BridgedDiagnosticSeverity severity,
- const void *sourceLocPtr,
- const unsigned char *textPtr,
- long textLen) {
- SwiftInt textLen) {
- StringRef origText{
- reinterpret_cast<const char *>(textPtr), size_t(textLen)};
- BridgedDiagnosticImpl::Allocator alloc;
- StringRef text = origText.copy(alloc);
+BridgedDiagnostic Diagnostic_create(BridgedDiagnosticEngine cDiags,
+ BridgedDiagnosticSeverity severity,
+ BridgedSourceLoc cLoc,
+ BridgedString cText) {
+ StringRef origText = convertString(cText);
llvm::MallocAllocator mallocAlloc;
StringRef text = origText.copy(mallocAlloc);
+ llvm::MallocAllocator mallocAlloc;
+ StringRef text = origText.copy(mallocAlloc);
- SourceLoc loc = getSourceLocFromPointer(sourceLocPtr);
+ SourceLoc loc = convertSourceLoc(cLoc);
@ -645,7 +651,7 @@ index b76dcfa8e5cc8..76b9b484e8f80 100644
- const void *replaceStartLocPtr,
- const void *replaceEndLocPtr,
- const unsigned char *newTextPtr,
- long newTextLen) {
- SwiftInt newTextLen) {
+void Diagnostic_fixItReplace(BridgedDiagnostic cDiag,
+ BridgedSourceLoc cStartLoc,
+ BridgedSourceLoc cEndLoc,
@ -658,9 +664,11 @@ index b76dcfa8e5cc8..76b9b484e8f80 100644
- StringRef origReplaceText{
- reinterpret_cast<const char *>(newTextPtr), size_t(newTextLen)};
- BridgedDiagnosticImpl::Allocator alloc;
- StringRef replaceText = origReplaceText.copy(alloc);
+ StringRef origReplaceText = convertString(cReplaceText);
llvm::MallocAllocator mallocAlloc;
StringRef replaceText = origReplaceText.copy(mallocAlloc);
+ llvm::MallocAllocator mallocAlloc;
+ StringRef replaceText = origReplaceText.copy(mallocAlloc);
- BridgedDiagnosticImpl *impl = static_cast<BridgedDiagnosticImpl *>(diagPtr);
- impl->textBlobs.push_back(replaceText);
@ -681,7 +689,7 @@ index b76dcfa8e5cc8..76b9b484e8f80 100644
-BridgedIdentifier
-SwiftASTContext_getIdentifier(void *ctx, const unsigned char *_Nullable str,
- long len) {
- SwiftInt len) {
- if (len == 1 && str[0] == '_')
+BridgedIdentifier ASTContext_getIdentifier(BridgedASTContext cContext,
+ BridgedString cStr) {
@ -739,7 +747,7 @@ index b76dcfa8e5cc8..76b9b484e8f80 100644
+ std::move(importPath).get());
}
-void *BridgedSourceLoc_advanced(void *loc, long len) {
-void *BridgedSourceLoc_advanced(void *loc, SwiftInt len) {
- SourceLoc l = getSourceLocFromPointer(loc).getAdvancedLoc(len);
- return const_cast<void *>(l.getOpaquePointerValue());
+BridgedSourceLoc SourceLoc_advanced(BridgedSourceLoc cLoc, long len) {
@ -854,7 +862,7 @@ index b76dcfa8e5cc8..76b9b484e8f80 100644
-void *SwiftStringLiteralExpr_create(void *ctx,
- const unsigned char *_Nullable string,
- long len, void *TokenLoc) {
- SwiftInt len, void *TokenLoc) {
- ASTContext &Context = *static_cast<ASTContext *>(ctx);
- auto stringRef = Context.AllocateCopy(
- StringRef{reinterpret_cast<const char *>(string), size_t(len)});
@ -869,7 +877,7 @@ index b76dcfa8e5cc8..76b9b484e8f80 100644
-void *SwiftIntegerLiteralExpr_create(void *ctx,
- const unsigned char *_Nullable string,
- long len, void *TokenLoc) {
- SwiftInt len, void *TokenLoc) {
- ASTContext &Context = *static_cast<ASTContext *>(ctx);
- auto stringRef = Context.AllocateCopy(
- StringRef{reinterpret_cast<const char *>(string), size_t(len)});
@ -1610,7 +1618,7 @@ index b76dcfa8e5cc8..76b9b484e8f80 100644
-void *GenericTypeParamDecl_create(void *ctx, void *declContext,
- BridgedIdentifier name, void *nameLoc,
- void *_Nullable eachLoc, long index,
- void *_Nullable eachLoc, SwiftInt index,
+void *GenericTypeParamDecl_create(BridgedASTContext cContext,
+ BridgedDeclContext cDeclContext,
+ BridgedIdentifier name,
@ -1764,7 +1772,7 @@ index 815bb696b137b..d1f60d3a94df3 100644
+ let equalLoc = bridgedSourceLoc(for: node.initializer.equal)
var nameText = node.identifier.text
- let name = nameText.withUTF8 { buf in
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ let name = nameText.withBridgedString { bridgedName in
+ return ASTContext_getIdentifier(ctx, bridgedName)
}
@ -1781,7 +1789,7 @@ index 815bb696b137b..d1f60d3a94df3 100644
+ let loc = bridgedSourceLoc(for: node)
var nameText = node.identifier.text
- let name = nameText.withUTF8 { buf in
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ let name = nameText.withBridgedString { bridgedName in
+ return ASTContext_getIdentifier(ctx, bridgedName)
}
@ -1795,7 +1803,7 @@ index 815bb696b137b..d1f60d3a94df3 100644
+ let loc = bridgedSourceLoc(for: node)
var nameText = node.identifier.text
- let name = nameText.withUTF8 { buf in
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ let name = nameText.withBridgedString { bridgedName in
+ return ASTContext_getIdentifier(ctx, bridgedName)
}
@ -1833,7 +1841,7 @@ index 815bb696b137b..d1f60d3a94df3 100644
// Swift AST represents "_" as nil.
var text = nodeFirstName.text
- firstName = text.withUTF8 { buf in
- SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ firstName = text.withBridgedString { bridgedName in
+ ASTContext_getIdentifier(ctx, bridgedName)
}
@ -1844,7 +1852,7 @@ index 815bb696b137b..d1f60d3a94df3 100644
if let nodeSecondName = node.secondName {
var text = nodeSecondName.text
- secondName = text.withUTF8 { buf in
- SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ secondName = text.withBridgedString { bridgedName in
+ ASTContext_getIdentifier(ctx, bridgedName)
}
@ -1867,7 +1875,7 @@ index 815bb696b137b..d1f60d3a94df3 100644
var nameText = node.identifier.text
- let name = nameText.withUTF8 { buf in
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ let name = nameText.withBridgedString { bridgedName in
+ return ASTContext_getIdentifier(ctx, bridgedName)
}
@ -1918,7 +1926,7 @@ index 7071029c43983..4d299cc6f19eb 100644
- let diag = mutableMessage.withUTF8 { messageBuffer in
- SwiftDiagnostic_create(
- diagEnginePtr, bridgedSeverity, sourceLoc(at: position),
- messageBuffer.baseAddress, messageBuffer.count
- messageBuffer.baseAddress, SwiftInt(messageBuffer.count)
+ let diag = mutableMessage.withBridgedString { bridgedMessage in
+ Diagnostic_create(
+ bridgedDiagEngine, bridgedSeverity, bridgedSourceLoc(at: position),
@ -1974,7 +1982,7 @@ index 7071029c43983..4d299cc6f19eb 100644
+ newText.withBridgedString { bridgedMessage in
+ Diagnostic_fixItReplace(
diag, replaceStartLoc, replaceEndLoc,
- textBuffer.baseAddress, textBuffer.count
- textBuffer.baseAddress, SwiftInt(textBuffer.count)
+ bridgedMessage
)
}
@ -2000,7 +2008,7 @@ index 7071029c43983..4d299cc6f19eb 100644
- SwiftDiagnostic_create(
- cxxDiagnosticEngine, bridgedSeverity,
- cxxSourceLocation(for: node, at: position),
- messageBuffer.baseAddress, messageBuffer.count
- messageBuffer.baseAddress, SwiftInt(messageBuffer.count)
+ let diag = mutableMessage.withBridgedString { bridgedMessage in
+ Diagnostic_create(
+ bridgedDiagEngine, bridgedSeverity,
@ -2071,7 +2079,7 @@ index 7071029c43983..4d299cc6f19eb 100644
+ newText.withBridgedString { bridgedMessage in
+ Diagnostic_fixItReplace(
diag, replaceStartLoc, replaceEndLoc,
- textBuffer.baseAddress, textBuffer.count
- textBuffer.baseAddress, SwiftInt(textBuffer.count)
+ bridgedMessage
)
}
@ -2173,7 +2181,7 @@ index 38097c72cc218..432a1e77cbee2 100644
var text = node.identifier.text
- let id = text.withUTF8 { buf in
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ let id = text.withBridgedString { bridgedText in
+ return ASTContext_getIdentifier(ctx, bridgedText)
}
@ -2188,7 +2196,7 @@ index 38097c72cc218..432a1e77cbee2 100644
var text = node.identifier.text
- let id = text.withUTF8 { buf in
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ let id = text.withBridgedString { bridgedText in
+ return ASTContext_getIdentifier(ctx, bridgedText)
}
@ -2203,7 +2211,7 @@ index 38097c72cc218..432a1e77cbee2 100644
let base = visit(node.base!).rawValue
var nameText = node.name.text
- let name = nameText.withUTF8 { buf in
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ let name = nameText.withBridgedString { bridgedName in
+ return ASTContext_getIdentifier(ctx, bridgedName)
}
@ -2214,7 +2222,7 @@ index 38097c72cc218..432a1e77cbee2 100644
return nil
}
- return name.withUTF8 { buf in
- SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ return name.withBridgedString { bridgedName in
+ ASTContext_getIdentifier(ctx, bridgedName)
}
@ -2266,7 +2274,7 @@ index 22163381143b0..46b4b3bf90419 100644
func visit(_ node: GenericParameterSyntax) -> ASTNode {
var nodeName = node.name.text
- let name = nodeName.withUTF8 { buf in
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ let name = nodeName.withBridgedString { bridgedName in
+ return ASTContext_getIdentifier(ctx, bridgedName)
}
@ -2280,7 +2288,7 @@ index 22163381143b0..46b4b3bf90419 100644
@@ -37,7 +35,7 @@ extension ASTGenVisitor {
return .decl(
GenericTypeParamDecl_create(
self.ctx, self.declContext, name, nameLoc, eachLoc, genericParameterIndex,
self.ctx, self.declContext, name, nameLoc, eachLoc, SwiftInt(genericParameterIndex),
- eachLoc != nil))
+ eachLoc.raw != nil))
}
@ -2317,7 +2325,7 @@ index 1653d09ac348d..21d538df2d939 100644
var segment = node.segments.first!.as(StringSegmentSyntax.self)!.content.text
return .expr(
- segment.withUTF8 { buf in
- return SwiftStringLiteralExpr_create(ctx, buf.baseAddress, buf.count, loc)
- return SwiftStringLiteralExpr_create(ctx, buf.baseAddress, SwiftInt(buf.count), loc)
+ segment.withBridgedString { bridgedSegment in
+ return StringLiteralExpr_create(ctx, bridgedSegment, loc)
})
@ -2329,7 +2337,7 @@ index 1653d09ac348d..21d538df2d939 100644
var segment = node.digits.text
return .expr(
- segment.withUTF8 { buf in
- return SwiftIntegerLiteralExpr_create(ctx, buf.baseAddress, buf.count, loc)
- return SwiftIntegerLiteralExpr_create(ctx, buf.baseAddress, SwiftInt(buf.count), loc)
+ segment.withBridgedString { bridgedSegment in
+ return IntegerLiteralExpr_create(ctx, bridgedSegment, loc)
})
@ -2442,7 +2450,7 @@ index ee90ad3990f2f..e14c14db41ded 100644
- SwiftDiagnostic_create(
- cxxDiagnosticEngine, bridgedSeverity,
- cxxSourceLocation(at: position),
- messageBuffer.baseAddress, messageBuffer.count)
- messageBuffer.baseAddress, SwiftInt(messageBuffer.count))
+ let diag = mutableMessage.withBridgedString { bridgedMessage in
+ Diagnostic_create(
+ bridgedDiagEngine, bridgedSeverity,
@ -2469,7 +2477,7 @@ index ee90ad3990f2f..e14c14db41ded 100644
var newText = change.newText
- newText.withUTF8 { textBuffer in
- SwiftDiagnostic_fixItReplace(
- diag, startLoc, endLoc, textBuffer.baseAddress, textBuffer.count)
- diag, startLoc, endLoc, textBuffer.baseAddress, SwiftInt(textBuffer.count))
+ newText.withBridgedString { bridgedFixItText in
+ Diagnostic_fixItReplace(
+ diag, startLoc, endLoc, bridgedFixItText)
@ -2674,7 +2682,7 @@ index 82bbca53bf4b2..34a185fe13fbf 100644
var text = node.name.text
- let id = text.withUTF8 { buf in
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ let id = text.withBridgedString { bridgedText in
+ return ASTContext_getIdentifier(ctx, bridgedText)
}
@ -2695,7 +2703,7 @@ index 82bbca53bf4b2..34a185fe13fbf 100644
var nameText = nameToken.text
- let name = nameText.withUTF8 { buf in
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
+ let name = nameText.withBridgedString { bridgedName in
+ return ASTContext_getIdentifier(ctx, bridgedName)
}
@ -2862,7 +2870,7 @@ index 82bbca53bf4b2..34a185fe13fbf 100644
for element in elementList {
var nameText = element.name?.text
- let name = nameText?.withUTF8 { buf in
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
- }
- let nameLoc = element.name.map { self.base.advanced(by: $0.position.utf8Offset).raw }
+ let name = nameText?.withBridgedString { bridgedName in
@ -2871,7 +2879,7 @@ index 82bbca53bf4b2..34a185fe13fbf 100644
+ let nameLoc = bridgedSourceLoc(for: element.name)
var secondNameText = element.secondName?.text
- let secondName = secondNameText?.withUTF8 { buf in
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, buf.count)
- return SwiftASTContext_getIdentifier(ctx, buf.baseAddress, SwiftInt(buf.count))
- }
- let secondNameLoc = element.secondName.map {
- self.base.advanced(by: $0.position.utf8Offset).raw

View File

@ -139,28 +139,27 @@ diff --git a/swift/cmake/modules/AddPureSwift.cmake b/swift/cmake/modules/AddPur
index 6c79fdcf351ce..953c607947fc0 100644
--- a/swift/cmake/modules/AddPureSwift.cmake
+++ b/swift/cmake/modules/AddPureSwift.cmake
@@ -2,18 +2,14 @@ include(macCatalystUtils)
@@ -2,17 +2,15 @@ include(macCatalystUtils)
# Workaround a cmake bug, see the corresponding function in swift-syntax
function(force_target_link_libraries TARGET)
- cmake_parse_arguments(ARGS "" "" "PUBLIC" ${ARGN})
-
- foreach(DEPENDENCY ${ARGS_PUBLIC})
- target_link_libraries(${TARGET} PRIVATE
- ${DEPENDENCY}
- )
- target_link_libraries(${TARGET} PRIVATE ${DEPENDENCY})
- add_dependencies(${TARGET} ${DEPENDENCY})
+ target_link_libraries(${TARGET} ${ARGN})
+ cmake_parse_arguments(ARGS "PUBLIC;PRIVATE;INTERFACE" "" "" ${ARGN})
+ foreach(DEPENDENCY ${ARGS_UNPARSED_ARGUMENTS})
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/forced-${DEPENDENCY}-dep.swift
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/forced-${DEPENDENCY}-dep.swift
string(REGEX REPLACE [<>:\"/\\|?*] _ sanitized ${DEPENDENCY})
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/forced-${sanitized}-dep.swift
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/forced-${sanitized}-dep.swift
DEPENDS ${DEPENDENCY}
- )
+ )
target_sources(${TARGET} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/forced-${DEPENDENCY}-dep.swift
${CMAKE_CURRENT_BINARY_DIR}/forced-${sanitized}-dep.swift
)
@@ -46,21 +44,7 @@ function(_add_host_swift_compile_options name)
$<$<COMPILE_LANGUAGE:Swift>:-runtime-compatibility-version>
@ -508,7 +507,7 @@ index 7a6f55c80406f..3c580fd824fb0 100644
set(SWIFT_SYNTAX_MODULES
SwiftBasicFormat
SwiftParser
@@ -32,104 +30,39 @@ if (SWIFT_SWIFT_PARSER)
@@ -32,130 +30,43 @@ if (SWIFT_SWIFT_PARSER)
SwiftCompilerPluginMessageHandling
)
@ -523,12 +522,18 @@ index 7a6f55c80406f..3c580fd824fb0 100644
-
- # Determine the SwiftSyntax shared library files that were built as
- # part of earlyswiftsyntax.
- list(TRANSFORM SWIFT_SYNTAX_MODULES PREPEND ${CMAKE_SHARED_LIBRARY_PREFIX}
- list(TRANSFORM SWIFT_SYNTAX_MODULES PREPEND "${CMAKE_SHARED_LIBRARY_PREFIX}"
- OUTPUT_VARIABLE SWIFT_SYNTAX_SHARED_LIBRARIES)
- list(TRANSFORM SWIFT_SYNTAX_SHARED_LIBRARIES APPEND
- ${CMAKE_SHARED_LIBRARY_SUFFIX}
- "${CMAKE_SHARED_LIBRARY_SUFFIX}"
- OUTPUT_VARIABLE SWIFT_SYNTAX_SHARED_LIBRARIES)
-
- list(TRANSFORM SWIFT_SYNTAX_MODULES PREPEND "${CMAKE_IMPORT_LIBRARY_PREFIX}"
- OUTPUT_VARIABLE SWIFT_SYNTAX_IMPORT_LIBRARIES)
- list(TRANSFORM SWIFT_SYNTAX_IMPORT_LIBRARIES APPEND
- "${CMAKE_IMPORT_LIBRARY_SUFFIX}" OUTPUT_VARIABLE
- SWIFT_SYNTAX_IMPORT_LIBRARIES)
-
- # Interface library to collect swiftinterfaces and swiftmodules from
- # SwiftSyntax
- add_library(swiftSyntaxLibraries INTERFACE)
@ -547,59 +552,57 @@ index 7a6f55c80406f..3c580fd824fb0 100644
- )
- endif()
-
- add_custom_command(
- OUTPUT "${SWIFT_HOST_LIBRARIES_DEST_DIR}/${sharedlib}"
- DEPENDS "${SWIFT_SYNTAX_LIBRARIES_BUILD_DIR}/${sharedlib}"
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SWIFT_SYNTAX_LIBRARIES_BUILD_DIR}/${sharedlib} ${SWIFT_HOST_LIBRARIES_DEST_DIR}/${sharedlib}
- ${add_origin_rpath}
- )
-
- add_custom_target(copy_swiftSyntaxLibrary_${sharedlib}
- DEPENDS "${SWIFT_HOST_LIBRARIES_DEST_DIR}/${sharedlib}"
- COMMENT "Copying ${sharedlib}"
- )
-
- swift_install_in_component(
- PROGRAMS "${SWIFT_HOST_LIBRARIES_DEST_DIR}/${sharedlib}"
- DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host"
- COMPONENT compiler
- )
- if(CMAKE_SYSTEM_NAME MATCHES Windows)
- add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${sharedlib}
- DEPENDS "${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/bin/${sharedlib}"
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/bin/${sharedlib} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${sharedlib})
- add_custom_target(copy_swiftSyntaxLibrary_${sharedlib}
- DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${sharedlib}
- COMMENT "copying ${sharedlib}")
- swift_install_in_component(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${sharedlib}
- DESTINATION bin
- COMPONENT compiler)
- else()
- add_custom_command(OUTPUT "${SWIFT_HOST_LIBRARIES_DEST_DIR}/${sharedlib}"
- DEPENDS "${SWIFT_SYNTAX_LIBRARIES_BUILD_DIR}/${sharedlib}"
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SWIFT_SYNTAX_LIBRARIES_BUILD_DIR}/${sharedlib} ${SWIFT_HOST_LIBRARIES_DEST_DIR}/${sharedlib}
- ${add_origin_rpath})
- add_custom_target(copy_swiftSyntaxLibrary_${sharedlib}
- DEPENDS "${SWIFT_HOST_LIBRARIES_DEST_DIR}/${sharedlib}"
- COMMENT "Copying ${sharedlib}")
- swift_install_in_component(PROGRAMS "${SWIFT_HOST_LIBRARIES_DEST_DIR}/${sharedlib}"
- DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host"
- COMPONENT compiler)
- endif()
-
- add_dependencies(swiftSyntaxLibraries copy_swiftSyntaxLibrary_${sharedlib})
+ if(CMAKE_SYSTEM_NAME MATCHES Windows)
- endforeach()
-
+ # Install shared runtime libraries
if(CMAKE_SYSTEM_NAME MATCHES Windows)
- foreach(implib ${SWIFT_SYNTAX_IMPORT_LIBRARIES})
- add_custom_command(OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/swift/windows/${SWIFT_HOST_VARIANT_ARCH}/${implib}
- DEPENDS ${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/lib/swift/host/${implib}
- COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/lib/swift/host/${implib} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/swift/windows/${SWIFT_HOST_VARIANT_ARCH}/${implib})
- add_custom_target(copy_swiftSyntaxLibrary_${implib}
- DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/swift/windows/${SWIFT_HOST_VARIANT_ARCH}/${implib}
- COMMENT "Copying ${implib}")
- swift_install_in_component(PROGRAMS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/swift/windows/${SWIFT_HOST_VARIANT_ARCH}/${implib}
- DESTINATION lib
- COMPONENT compiler)
- add_dependencies(swiftSyntaxLibraries copy_swiftSyntaxLibrary_${implib})
- endforeach()
+ swift_install_in_component(TARGETS ${SWIFT_SYNTAX_MODULES}
+ RUNTIME
+ DESTINATION "bin"
+ COMPONENT compiler)
+ COMPONENT swift-syntax-lib)
+ else()
+ swift_install_in_component(TARGETS ${SWIFT_SYNTAX_MODULES}
+ LIBRARY
+ DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host"
+ COMPONENT compiler)
+ endif()
+
+ # Install import libraries in Windows.
+ if(CMAKE_SYSTEM_NAME MATCHES Windows)
+ list(TRANSFORM SWIFT_SYNTAX_MODULES
+ PREPEND "${CMAKE_IMPORT_LIBRARY_PREFIX}"
+ OUTPUT_VARIABLE SWIFT_SYNTAX_IMPORT_LIBRARIES)
+ list(TRANSFORM SWIFT_SYNTAX_IMPORT_LIBRARIES
+ APPEND "${CMAKE_IMPORT_LIBRARY_SUFFIX}"
+ OUTPUT_VARIABLE SWIFT_SYNTAX_IMPORT_LIBRARIES)
+ list(TRANSFORM SWIFT_SYNTAX_IMPORT_LIBRARIES
+ PREPEND "${SWIFT_HOST_LIBRARIES_DEST_DIR}/"
+ OUTPUT_VARIABLE SWIFT_SYNTAX_IMPORT_LIBRARIES)
+ swift_install_in_component(PROGRAMS "${SWIFT_SYNTAX_IMPORT_LIBRARIES}"
+ DESTINATION lib
+ COMPONENT compiler)
+ endif()
+
+ foreach(module ${SWIFT_SYNTAX_MODULES})
+ set(module_dir "${module}.swiftmodule")
+ set(module_file "${SWIFT_HOST_LIBRARIES_DEST_DIR}/${module_dir}/${SWIFT_HOST_MODULE_TRIPLE}.swiftinterface")
+ swift_install_in_component(FILES "${module_file}"
+ DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host/${module_dir}"
+ COMPONENT compiler)
endforeach()
-
+ COMPONENT swift-syntax-lib)
endif()
- # Copy all of the Swift modules from earlyswiftsyntax so they can be found
- # in the same relative place within the build directory as in the final
- # toolchain.
@ -636,9 +639,31 @@ index 7a6f55c80406f..3c580fd824fb0 100644
- DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host/${module_dir}"
- COMPONENT compiler
- )
-
+ # Install import libraries in Windows.
+ if(CMAKE_SYSTEM_NAME MATCHES Windows)
+ list(TRANSFORM SWIFT_SYNTAX_MODULES
+ PREPEND "${CMAKE_IMPORT_LIBRARY_PREFIX}"
+ OUTPUT_VARIABLE SWIFT_SYNTAX_IMPORT_LIBRARIES)
+ list(TRANSFORM SWIFT_SYNTAX_IMPORT_LIBRARIES
+ APPEND "${CMAKE_IMPORT_LIBRARY_SUFFIX}"
+ OUTPUT_VARIABLE SWIFT_SYNTAX_IMPORT_LIBRARIES)
+ list(TRANSFORM SWIFT_SYNTAX_IMPORT_LIBRARIES
+ PREPEND "${SWIFT_HOST_LIBRARIES_DEST_DIR}/"
+ OUTPUT_VARIABLE SWIFT_SYNTAX_IMPORT_LIBRARIES)
+ swift_install_in_component(PROGRAMS "${SWIFT_SYNTAX_IMPORT_LIBRARIES}"
+ DESTINATION lib
+ COMPONENT swift-syntax-lib)
+ endif()
- add_dependencies(swiftSyntaxLibraries copy_swiftSyntaxModule_${module_dir})
- endforeach()
+ # Install Swift module interface files.
+ foreach(module ${SWIFT_SYNTAX_MODULES})
+ set(module_dir "${module}.swiftmodule")
+ set(module_file "${SWIFT_HOST_LIBRARIES_DEST_DIR}/${module_dir}/${SWIFT_HOST_MODULE_TRIPLE}.swiftinterface")
+ swift_install_in_component(FILES "${module_file}"
+ DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host/${module_dir}"
+ COMPONENT swift-syntax-lib)
endforeach()
-
- # Add copied SwiftSyntax libraries to global dependencies.
- list(APPEND LLVM_COMMON_DEPENDS swiftSyntaxLibraries)
@ -1112,11 +1137,13 @@ diff --git a/swift/tools/driver/CMakeLists.txt b/swift/tools/driver/CMakeLists.t
index f08e56ee3c2f1..1b350f229d4a5 100644
--- a/swift/tools/driver/CMakeLists.txt
+++ b/swift/tools/driver/CMakeLists.txt
@@ -4,7 +4,7 @@
@@ -4,9 +4,7 @@
# Add additional libraries to which we need to link when the Swift Swift
# parser is built in.
function(add_swift_parser_link_libraries target)
- if(SWIFT_SWIFT_PARSER)
- target_link_directories(${target} PRIVATE
- ${SWIFT_PATH_TO_SWIFT_SDK}/usr/lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}/${SWIFT_HOST_VARIANT_ARCH})
+ if(SWIFT_BUILD_SWIFT_SYNTAX)
target_link_libraries(${target}
PRIVATE swiftCore)

View File

@ -15,7 +15,7 @@ diff --git a/swift-syntax/CMakeLists.txt b/swift-syntax/CMakeLists.txt
index aadf062ae5..c5a697ccc0 100644
--- a/swift-syntax/CMakeLists.txt
+++ b/swift-syntax/CMakeLists.txt
@@ -15,11 +15,28 @@ project(SwiftSyntax LANGUAGES C Swift)
@@ -15,12 +15,25 @@ project(SwiftSyntax LANGUAGES C Swift)
set(SWIFT_VERSION 5)
set(CMAKE_Swift_LANGUAGE_VERSION ${SWIFT_VERSION})
@ -31,16 +31,14 @@ index aadf062ae5..c5a697ccc0 100644
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/${SWIFT_HOST_LIBRARIES_SUBDIRECTORY}")
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/${SWIFT_HOST_LIBRARIES_SUBDIRECTORY}")
+if(SWIFT_HOST_LIBRARIES_DEST_DIR)
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${SWIFT_HOST_LIBRARIES_DEST_DIR}")
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${SWIFT_HOST_LIBRARIES_DEST_DIR}")
+else()
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/${SWIFT_HOST_LIBRARIES_SUBDIRECTORY}")
+endif()
+if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/${SWIFT_HOST_LIBRARIES_SUBDIRECTORY}")
+endif()
+if(SWIFT_HOST_RUNTIME_DEST_DIR)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${SWIFT_HOST_RUNTIME_DEST_DIR}")
+else()
+if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+endif()

View File

@ -108,22 +108,33 @@ diff --git a/swift/tools/swift-plugin-server/CMakeLists.txt b/swift/tools/swift-
index a21b79ed260..5b591a30514 100644
--- a/swift/tools/swift-plugin-server/CMakeLists.txt
+++ b/swift/tools/swift-plugin-server/CMakeLists.txt
@@ -11,16 +11,21 @@ if (SWIFT_BUILD_SWIFT_SYNTAX)
@@ -1,28 +1,19 @@
if (SWIFT_BUILD_SWIFT_SYNTAX)
- # _swiftCSwiftPluginServer is just a C support library for swift-plugin-server
- # Don't bother to create '.a' for that.
- add_swift_host_library(_swiftCSwiftPluginServer OBJECT
- Sources/CSwiftPluginServer/PluginServer.cpp
- )
- target_link_libraries(_swiftCSwiftPluginServer PRIVATE
- swiftDemangling
+ add_swift_host_tool(swift-plugin-server SWIFT_COMPONENT compiler Sources/CSwiftPluginServer/PluginServer.cpp)
+ add_pure_swift_host_library(SwiftPluginServer STATIC
+ Sources/swift-plugin-server/swift-plugin-server.swift
)
- target_include_directories(_swiftCSwiftPluginServer PUBLIC
+ target_include_directories(SwiftPluginServer PUBLIC
Sources/CSwiftPluginServer/include
)
-
- add_pure_swift_host_tool(swift-plugin-server
+ add_swift_host_tool(swift-plugin-server SWIFT_COMPONENT compiler)
+ add_pure_swift_host_library(SwiftPluginServer STATIC
Sources/swift-plugin-server/swift-plugin-server.swift
- Sources/swift-plugin-server/swift-plugin-server.swift
- DEPENDENCIES
+ )
+ target_include_directories(SwiftPluginServer PUBLIC
+ Sources/CSwiftPluginServer/include
+ )
+ target_link_libraries(SwiftPluginServer PRIVATE SwiftCompilerPluginMessageHandling)
+ target_link_libraries(swift-plugin-server PRIVATE
swiftDemangling
$<TARGET_OBJECTS:_swiftCSwiftPluginServer>
- $<TARGET_OBJECTS:_swiftCSwiftPluginServer>
- SWIFT_COMPONENT
- compiler
- SWIFT_DEPENDENCIES
SwiftSyntaxMacros
SwiftSyntaxMacroExpansion

View File

@ -19,7 +19,7 @@ termux_setup_swift() {
termux_download \
https://download.swift.org/swift-$TERMUX_SWIFT_VERSION-release/ubuntu2204/swift-$TERMUX_SWIFT_VERSION-$SWIFT_RELEASE/$SWIFT_BIN.tar.gz \
$SWIFT_TAR \
bca015e9d727ca39385d7e5b5399f46302d54a02218d40d1c3063662ffc6b42f
ea2fe1190a9cb8abed8c5e7b94223a06a23c7dc8cd498850a1c79b8a87e7c251
(cd $TERMUX_PKG_TMPDIR ; tar xf $SWIFT_TAR ; mv $SWIFT_BIN $SWIFT_FOLDER; rm $SWIFT_TAR)
fi