[Wasm] Basic CLI

-Xwasm option that will produce wasm instead of JS when used with -Xir-produce-js
Does not affect klib production
This commit is contained in:
Svyatoslav Kuzmich
2020-10-19 17:34:31 +03:00
parent 80f316168e
commit e51a76bc4e
7 changed files with 125 additions and 112 deletions
@@ -178,6 +178,9 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
@Argument(value = "-Xerror-tolerance-policy", description = "Set up error tolerance policy (NONE, SEMANTIC, SYNTAX, ALL)")
var errorTolerancePolicy: String? by NullableStringFreezableVar(null)
@Argument(value = "-Xwasm", description = "Use experimental WebAssembly compiler backend")
var wasm: Boolean by FreezableVar(false)
override fun checkIrSupport(languageVersionSettings: LanguageVersionSettings, collector: MessageCollector) {
if (!isIrBackendEnabled()) return
@@ -196,4 +199,4 @@ fun K2JSCompilerArguments.isPreIrBackendDisabled(): Boolean =
irOnly || irProduceJs || irProduceKlibFile
fun K2JSCompilerArguments.isIrBackendEnabled(): Boolean =
irProduceKlibDir || irProduceJs || irProduceKlibFile
irProduceKlibDir || irProduceJs || irProduceKlibFile || wasm