File tree 2 files changed +10
-9
lines changed
2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -115,15 +115,13 @@ extension WebAssemblyToolchain {
115
115
commandLine. appendPath ( path)
116
116
}
117
117
118
- // Link the standard library.
119
- let linkFilePath : VirtualPath = VirtualPath . lookup ( targetInfo. runtimeResourcePath. path)
120
- . appending (
121
- components: targetTriple. platformName ( ) ?? " " ,
122
- " static-executable-args.lnk "
123
- )
124
-
118
+ // Link the standard library and dependencies.
119
+ let linkFilePath : VirtualPath =
120
+ VirtualPath . lookup ( targetInfo. runtimeResourcePath. path)
121
+ . appending ( components: targetTriple. platformName ( ) ?? " " ,
122
+ " static-executable-args.lnk " )
125
123
guard try fileSystem. exists ( linkFilePath) else {
126
- fatalError ( " \( linkFilePath) not found " )
124
+ throw Error . missingExternalDependency ( linkFilePath. name )
127
125
}
128
126
commandLine. append ( . responseFilePath( linkFilePath) )
129
127
@@ -133,7 +131,7 @@ extension WebAssemblyToolchain {
133
131
// Delegate to Clang for sanitizers. It will figure out the correct linker
134
132
// options.
135
133
guard sanitizers. isEmpty else {
136
- fatalError ( " WebAssembly does not support sanitizers, but a runtime library was found " )
134
+ throw Error . sanitizersUnsupportedForTarget ( targetTriple . triple )
137
135
}
138
136
139
137
guard !parsedOptions. hasArgument ( . profileGenerate) else {
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ public final class WebAssemblyToolchain: Toolchain {
24
24
case dynamicLibrariesUnsupportedForTarget( String )
25
25
case sanitizersUnsupportedForTarget( String )
26
26
case profilingUnsupportedForTarget( String )
27
+ case missingExternalDependency( String )
27
28
28
29
public var description : String {
29
30
switch self {
@@ -35,6 +36,8 @@ public final class WebAssemblyToolchain: Toolchain {
35
36
return " sanitizers are unsupported for target ' \( triple) ' "
36
37
case . profilingUnsupportedForTarget( let triple) :
37
38
return " profiling is unsupported for target ' \( triple) ' "
39
+ case . missingExternalDependency( let dependency) :
40
+ return " missing external dependency ' \( dependency) ' "
38
41
}
39
42
}
40
43
}
You can’t perform that action at this time.
0 commit comments