Skip to content

Commit bf5b1e0

Browse files
PackageToJS: Add hint for missing .enableExperimentalFeature("Extern") setting
1 parent 42ead29 commit bf5b1e0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Plugins/PackageToJS/Sources/PackageToJSPlugin.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,27 @@ struct PackageToJSPlugin: CommandPlugin {
7171
See https://book.swiftwasm.org/getting-started/setup.html for more information.
7272
"""
7373
}),
74+
(
75+
// In case the SwiftPM target using BridgeJS didn't specify `.enableExperimentalFeature("Extern")`
76+
{ build, arguments in
77+
guard
78+
build.logText.contains("@_extern requires '-enable-experimental-feature Extern'")
79+
else {
80+
return nil
81+
}
82+
return """
83+
The SwiftPM target using BridgeJS didn't specify `.enableExperimentalFeature("Extern")`.
84+
Please add it to the target's `swiftSettings` configuration.
85+
86+
For example:
87+
```swift
88+
dependencies: [...],
89+
swiftSettings: [
90+
.enableExperimentalFeature("Extern"),
91+
]
92+
```
93+
"""
94+
}),
7495
]
7596

7697
private func emitHintMessage(_ message: String) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy