@@ -13,24 +13,24 @@ let package = Package(
13
13
. macCatalyst( . v13) ,
14
14
] ,
15
15
products: [
16
- . library( name: " SwiftBasicFormat " , targets: [ " SwiftBasicFormat " ] ) ,
17
- . library( name: " SwiftCompilerPlugin " , targets: [ " SwiftCompilerPlugin " ] ) ,
18
- . library( name: " SwiftDiagnostics " , targets: [ " SwiftDiagnostics " ] ) ,
19
- . library( name: " SwiftIDEUtils " , targets: [ " SwiftIDEUtils " ] ) ,
20
- . library( name: " SwiftIfConfig " , targets: [ " SwiftIfConfig " ] ) ,
21
- . library( name: " SwiftLexicalLookup " , targets: [ " SwiftLexicalLookup " ] ) ,
22
- . library( name: " SwiftOperators " , targets: [ " SwiftOperators " ] ) ,
23
- . library( name: " SwiftParser " , targets: [ " SwiftParser " ] ) ,
24
- . library( name: " SwiftParserDiagnostics " , targets: [ " SwiftParserDiagnostics " ] ) ,
25
- . library( name: " SwiftRefactor " , targets: [ " SwiftRefactor " ] ) ,
26
- . library( name: " SwiftSyntax " , targets: [ " SwiftSyntax " ] ) ,
27
- . library( name: " SwiftSyntaxBuilder " , targets: [ " SwiftSyntaxBuilder " ] ) ,
28
- . library( name: " SwiftSyntaxMacros " , targets: [ " SwiftSyntaxMacros " ] ) ,
29
- . library( name: " SwiftSyntaxMacroExpansion " , targets: [ " SwiftSyntaxMacroExpansion " ] ) ,
30
- . library( name: " SwiftSyntaxMacrosTestSupport " , targets: [ " SwiftSyntaxMacrosTestSupport " ] ) ,
31
- . library( name: " SwiftSyntaxMacrosGenericTestSupport " , targets: [ " SwiftSyntaxMacrosGenericTestSupport " ] ) ,
32
- . library( name: " _SwiftCompilerPluginMessageHandling " , targets: [ " SwiftCompilerPluginMessageHandling " ] ) ,
33
- . library( name: " _SwiftLibraryPluginProvider " , targets: [ " SwiftLibraryPluginProvider " ] ) ,
16
+ . library( name: " SwiftBasicFormat " , type : type , targets: [ " SwiftBasicFormat " ] ) ,
17
+ . library( name: " SwiftCompilerPlugin " , type : type , targets: [ " SwiftCompilerPlugin " ] ) ,
18
+ . library( name: " SwiftDiagnostics " , type : type , targets: [ " SwiftDiagnostics " ] ) ,
19
+ . library( name: " SwiftIDEUtils " , type : type , targets: [ " SwiftIDEUtils " ] ) ,
20
+ . library( name: " SwiftIfConfig " , type : type , targets: [ " SwiftIfConfig " ] ) ,
21
+ . library( name: " SwiftLexicalLookup " , type : type , targets: [ " SwiftLexicalLookup " ] ) ,
22
+ . library( name: " SwiftOperators " , type : type , targets: [ " SwiftOperators " ] ) ,
23
+ . library( name: " SwiftParser " , type : type , targets: [ " SwiftParser " ] ) ,
24
+ . library( name: " SwiftParserDiagnostics " , type : type , targets: [ " SwiftParserDiagnostics " ] ) ,
25
+ . library( name: " SwiftRefactor " , type : type , targets: [ " SwiftRefactor " ] ) ,
26
+ . library( name: " SwiftSyntax " , type : type , targets: [ " SwiftSyntax " ] ) ,
27
+ . library( name: " SwiftSyntaxBuilder " , type : type , targets: [ " SwiftSyntaxBuilder " ] ) ,
28
+ . library( name: " SwiftSyntaxMacros " , type : type , targets: [ " SwiftSyntaxMacros " ] ) ,
29
+ . library( name: " SwiftSyntaxMacroExpansion " , type : type , targets: [ " SwiftSyntaxMacroExpansion " ] ) ,
30
+ . library( name: " SwiftSyntaxMacrosTestSupport " , type : type , targets: [ " SwiftSyntaxMacrosTestSupport " ] ) ,
31
+ . library( name: " SwiftSyntaxMacrosGenericTestSupport " , type : type , targets: [ " SwiftSyntaxMacrosGenericTestSupport " ] ) ,
32
+ . library( name: " _SwiftCompilerPluginMessageHandling " , type : type , targets: [ " SwiftCompilerPluginMessageHandling " ] ) ,
33
+ . library( name: " _SwiftLibraryPluginProvider " , type : type , targets: [ " SwiftLibraryPluginProvider " ] ) ,
34
34
] ,
35
35
targets: [
36
36
// MARK: - Internal helper targets
@@ -407,6 +407,18 @@ var rawSyntaxValidation: Bool { hasEnvironmentVariable("SWIFTSYNTAX_ENABLE_RAWSY
407
407
/// See CONTRIBUTING.md for more information
408
408
var alternateTokenIntrospection : Bool { hasEnvironmentVariable ( " SWIFTPARSER_ENABLE_ALTERNATE_TOKEN_INTROSPECTION " ) }
409
409
410
+ /// The types of libraries to build.
411
+ ///
412
+ /// This allows us to build swift-syntax as dynamic libraries, which in turn allows us to build SourceKit-LSP using
413
+ /// SwiftPM on Windows. Linking swift-syntax statically into sourcekit-lsp exceeds the maximum number of exported
414
+ /// symbols on Windows.
415
+ var type : Product . Library . LibraryType ? {
416
+ if hasEnvironmentVariable ( " SWIFTSYNTAX_BUILD_DYNAMIC_LIBRARIES " ) {
417
+ return . dynamic
418
+ }
419
+ return nil
420
+ }
421
+
410
422
// MARK: - Compute custom build settings
411
423
412
424
// These build settings apply to the target and the corresponding test target.
0 commit comments