package org.shedlang.compiler.backends.targets; import org.shedlang.compiler.backends.wasm.structure.ast.types.WasmIndexType; import org.shedlang.compiler.backends.wasm.structure.ast.types.WasmValueType; import java.util.List; public enum WasmTarget { WASM32( "wasm32", WasmIndexType.I32, WasmValueType.I32, List.of(), List.of(), List.of(), List.of() ), WASM64( "wasm64", WasmIndexType.I64, WasmValueType.I64, List.of("-mwasm64"), List.of("--enable-memory64"), List.of(), List.of("--wasm64") ); private final String targetName; private final WasmIndexType indexType; private final WasmValueType sizeT; private final List linkerFlags; private final List wabtFlags; private final List nodeFlags; private final List runWasmFlags; WasmTarget( String targetName, WasmIndexType indexType, WasmValueType sizeT, List linkerFlags, List wabtFlags, List nodeFlags, List runWasmFlags ) { this.targetName = targetName; this.indexType = indexType; this.sizeT = sizeT; this.linkerFlags = linkerFlags; this.wabtFlags = wabtFlags; this.nodeFlags = nodeFlags; this.runWasmFlags = runWasmFlags; } public String targetName() { return targetName; } public WasmIndexType indexType() { return indexType; } public WasmValueType sizeT() { return sizeT; } public WasmValueType dataPtrType() { return sizeT; } public WasmValueType functionPtrType() { return sizeT; } public WasmValueType patioIntType() { return sizeT; } public List linkerFlags() { return linkerFlags; } public List wabtFlags() { return wabtFlags; } public List nodeFlags() { return this.nodeFlags; } public List runWasmFlags() { return this.runWasmFlags; } }