Override the top level default target in the case of WASM#622
Conversation
BUILD.gn
Outdated
| ] | ||
| if (target_os == "wasm") { | ||
| deps = [ | ||
| "//flutter/web_sdk/wasm:wasm_artifacts" |
There was a problem hiding this comment.
I think if we change things here, we should just make some specific target for wasm e.g. //flutter/wasm that is not specific to the web_sdk.
Alternatively, we should do this in //flutter/BUILD.gn.
There was a problem hiding this comment.
Putting it in //flutter/BUILD.gn causes problems due to targets and imports eventually leading somewhere that will throw due to target_cpu = "wasm". But putting it in //flutter/wasm/BUILD.gn sounds good to me. The WASM stuff needs to be quarantined from the normal Flutter SDK build rules because otherwise gn gen will error out.
|
FYI here is the corresponding engine change with the |
BUILD.gn
Outdated
| ] | ||
| if (target_os == "wasm") { | ||
| deps = [ | ||
| "//flutter/wasm:wasm_artifacts" |
There was a problem hiding this comment.
Uber not: just make the target wasm.
If building for WASM, change the default target to build the WASM artifacts needed by the Web SDK.
This change is necessary for
gn gento work whentarget_cpu = "wasm"since the imports from//flutter/BUILD.gnlead to a check in//flutter/shell/platform/BUILD.gnwhich throws if the target CPU is not recognized.We do not (currently?) want to compile the Flutter SDK to WASM. Our only current use case is building CanvasKit for the Flutter Web SDK.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.