[Wasm] Fix wasm-target compiler key in gradle plugin

This commit is contained in:
Igor Yakovlev
2023-08-04 15:54:28 +02:00
committed by Space Team
parent a3aa1f6121
commit 87ab88957d
3 changed files with 5 additions and 7 deletions
@@ -29,4 +29,4 @@ internal const val PER_MODULE = "-Xir-per-module"
internal const val PER_MODULE_OUTPUT_NAME = "-Xir-per-module-output-name"
internal const val WASM_BACKEND = "-Xwasm"
internal const val WASM_WASI_MODE = "-Xwasm-wasi-mode"
internal const val WASM_TARGET = "-Xwasm-target"
@@ -109,9 +109,8 @@ internal open class BaseKotlin2JsCompileConfig<TASK : Kotlin2JsCompile>(
if (compilation.platformType == KotlinPlatformType.wasm) {
add(WASM_BACKEND)
val wasmTargetType = ((compilation.origin as KotlinJsIrCompilation).target as KotlinJsIrTarget).wasmTargetType!!
if (wasmTargetType == KotlinWasmTargetType.WASI) {
add(WASM_WASI_MODE)
}
val targetValue = if (wasmTargetType == KotlinWasmTargetType.WASI) "wasm-wasi" else "wasm-js"
add("$WASM_TARGET=$targetValue")
}
}
}
@@ -100,9 +100,8 @@ internal open class KotlinJsIrLinkConfig(
if (compilation.platformType == KotlinPlatformType.wasm) {
add(WASM_BACKEND)
val wasmTargetType = ((compilation.origin as KotlinJsIrCompilation).target as KotlinJsIrTarget).wasmTargetType!!
if (wasmTargetType == KotlinWasmTargetType.WASI) {
add(WASM_WASI_MODE)
}
val targetValue = if (wasmTargetType == KotlinWasmTargetType.WASI) "wasm-wasi" else "wasm-js"
add("$WASM_TARGET=$targetValue")
}
}
}