Fix jsinterop: added option target which now has only one proper value wasm32 (#2694)
This commit is contained in:
+7
@@ -68,6 +68,13 @@ fun getCInteropArguments(): List<OptionDescriptor> {
|
||||
return (options + getCommonInteropArguments())
|
||||
}
|
||||
|
||||
fun getJSInteropArguments(): List<OptionDescriptor> {
|
||||
val options = listOf(
|
||||
OptionDescriptor(ArgType.Choice(listOf("wasm32")), "target", description = "wasm target to compile to", defaultValue = "wasm32")
|
||||
)
|
||||
return (options + getCommonInteropArguments())
|
||||
}
|
||||
|
||||
internal fun warn(msg: String) {
|
||||
println("warning: $msg")
|
||||
}
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ import org.jetbrains.kotlin.konan.file.File
|
||||
import org.jetbrains.kotlin.native.interop.gen.argsToCompiler
|
||||
import org.jetbrains.kotlin.native.interop.gen.wasm.idl.*
|
||||
import org.jetbrains.kliopt.ArgParser
|
||||
import org.jetbrains.kotlin.native.interop.tool.getCommonInteropArguments
|
||||
import org.jetbrains.kotlin.native.interop.tool.getJSInteropArguments
|
||||
import org.jetbrains.kotlin.native.interop.tool.getValuesAsArray
|
||||
|
||||
fun kotlinHeader(packageName: String): String {
|
||||
@@ -393,7 +393,7 @@ const val idlMathPackage = "kotlinx.interop.wasm.math"
|
||||
const val idlDomPackage = "kotlinx.interop.wasm.dom"
|
||||
|
||||
fun processIdlLib(args: Array<String>, additionalArgs: Map<String, Any> = mapOf()): Array<String>? {
|
||||
val argParser = ArgParser(getCommonInteropArguments(), useDefaultHelpShortName = false)
|
||||
val argParser = ArgParser(getJSInteropArguments(), useDefaultHelpShortName = false)
|
||||
if (!argParser.parse(args))
|
||||
return null
|
||||
// TODO: Refactor me.
|
||||
|
||||
Reference in New Issue
Block a user