forked from swiftlang/swift-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlatformInfoExtension.swift
79 lines (58 loc) · 2.77 KB
/
PlatformInfoExtension.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
public import SWBUtil
public import SWBMacro
public struct PlatformInfoExtensionPoint: ExtensionPoint, Sendable {
public typealias ExtensionProtocol = PlatformInfoExtension
public static let name = "PlatformInfoExtensionPoint"
public init() {}
}
public protocol PlatformInfoExtension: Sendable {
func knownDeploymentTargetMacroNames() -> Set<String>
func preferredArchValue(for: String) -> String?
func additionalTestLibraryPaths(scope: MacroEvaluationScope, platform: Platform?, fs: any FSProxy) -> [Path]
func additionalKnownTestLibraryPathSuffixes() -> [Path]
func additionalPlatformExecutableSearchPaths(platformName: String, platformPath: Path, fs: any FSProxy) async -> [Path]
func additionalToolchainExecutableSearchPaths(toolchainIdentifier: String, toolchainPath: Path) -> [Path]
func additionalPlatforms(context: any PlatformInfoExtensionAdditionalPlatformsContext) throws -> [(path: Path, data: [String: PropertyListItem])]
func adjustPlatformSDKSearchPaths(platformName: String, platformPath: Path, sdkSearchPaths: inout [Path])
}
extension PlatformInfoExtension {
public func knownDeploymentTargetMacroNames() -> Set<String> {
[]
}
public func preferredArchValue(for: String) -> String? {
nil
}
public func additionalTestLibraryPaths(scope: MacroEvaluationScope, platform: SWBCore.Platform?, fs: any FSProxy) -> [Path] {
[]
}
public func additionalKnownTestLibraryPathSuffixes() -> [Path] {
[]
}
public func additionalPlatformExecutableSearchPaths(platformName: String, platformPath: Path, fs: any FSProxy) async -> [Path] {
[]
}
public func additionalToolchainExecutableSearchPaths(toolchainIdentifier: String, toolchainPath: Path) -> [Path] {
[]
}
public func additionalPlatforms(context: any PlatformInfoExtensionAdditionalPlatformsContext) throws -> [(path: Path, data: [String: PropertyListItem])] {
[]
}
public func adjustPlatformSDKSearchPaths(platformName: String, platformPath: Path, sdkSearchPaths: inout [Path]) {
}
}
public protocol PlatformInfoExtensionAdditionalPlatformsContext: Sendable {
var hostOperatingSystem: OperatingSystem { get }
var developerPath: Path { get }
var fs: any FSProxy { get }
}