File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed
Sources/SwiftSDKGenerator/SwiftSDKRecipes
Tests/SwiftSDKGeneratorTests/SwiftSDKRecipes Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -53,11 +53,16 @@ package protocol SwiftSDKRecipe: Sendable {
53
53
}
54
54
55
55
extension SwiftSDKRecipe {
56
- package func applyPlatformOptions( toolset: inout Toolset , targetTriple: Triple ) { }
56
+ package func applyPlatformOptions(
57
+ toolset: inout Toolset ,
58
+ targetTriple: Triple ,
59
+ isForEmbeddedSwift: Bool
60
+ ) { }
57
61
package func applyPlatformOptions(
58
62
metadata: inout SwiftSDKMetadataV4 . TripleProperties ,
59
63
paths: PathsConfiguration ,
60
- targetTriple: Triple
64
+ targetTriple: Triple ,
65
+ isForEmbeddedSwift: Bool
61
66
) { }
62
67
63
68
package var shouldSupportEmbeddedSwift : Bool { false }
Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ package struct WebAssemblyRecipe: SwiftSDKRecipe {
126
126
127
127
var finalTriple = targetTriple
128
128
if isForEmbeddedSwift {
129
+ metadata. targetTriples. removeValue ( forKey: targetTriple. triple)
129
130
finalTriple = Triple ( " wasm32-unknown-wasip1 " )
130
131
}
131
132
Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ final class LinuxRecipeTests: XCTestCase {
85
85
var toolset = Toolset ( rootPath: nil )
86
86
recipe. applyPlatformOptions (
87
87
toolset: & toolset,
88
- targetTriple: testCase. targetTriple
88
+ targetTriple: testCase. targetTriple,
89
+ isForEmbeddedSwift: false
89
90
)
90
91
XCTAssertEqual ( toolset. swiftCompiler? . extraCLIOptions, testCase. expectedSwiftCompilerOptions)
91
92
XCTAssertEqual ( toolset. linker? . path, testCase. expectedLinkerPath)
@@ -103,7 +104,8 @@ final class LinuxRecipeTests: XCTestCase {
103
104
var toolset = Toolset ( rootPath: " swift.xctoolchain " )
104
105
recipe. applyPlatformOptions (
105
106
toolset: & toolset,
106
- targetTriple: Triple ( " x86_64-unknown-linux-gnu " )
107
+ targetTriple: Triple ( " x86_64-unknown-linux-gnu " ) ,
108
+ isForEmbeddedSwift: false
107
109
)
108
110
XCTAssertEqual ( toolset. rootPath, nil )
109
111
XCTAssertEqual (
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ final class WebAssemblyRecipeTests: XCTestCase {
33
33
var toolset = Toolset ( rootPath: nil )
34
34
recipe. applyPlatformOptions (
35
35
toolset: & toolset,
36
- targetTriple: Triple ( " wasm32-unknown-wasi " )
36
+ targetTriple: Triple ( " wasm32-unknown-wasi " ) ,
37
+ isForEmbeddedSwift: false
37
38
)
38
39
XCTAssertEqual ( toolset. swiftCompiler? . extraCLIOptions, [ " -static-stdlib " ] )
39
40
XCTAssertNil ( toolset. cCompiler)
@@ -46,7 +47,8 @@ final class WebAssemblyRecipeTests: XCTestCase {
46
47
var toolset = Toolset ( rootPath: nil )
47
48
recipe. applyPlatformOptions (
48
49
toolset: & toolset,
49
- targetTriple: Triple ( " wasm32-unknown-wasip1-threads " )
50
+ targetTriple: Triple ( " wasm32-unknown-wasip1-threads " ) ,
51
+ isForEmbeddedSwift: false
50
52
)
51
53
XCTAssertEqual (
52
54
toolset. swiftCompiler? . extraCLIOptions,
You can’t perform that action at this time.
0 commit comments