import std; import Crafter.Build; namespace fs = std::filesystem; using namespace Crafter; extern "C" Configuration CrafterBuildProject(std::span) { Configuration cfg; cfg.path = "./"; cfg.name = "wasi-hello"; cfg.outputName = "wasi-hello"; cfg.target = "wasm32-wasip1"; cfg.type = ConfigurationType::Executable; std::array ifaces = {}; std::array impls = { "main" }; cfg.GetInterfacesAndImplementations(ifaces, impls); // Drop a small index.html + runtime.js next to the .wasm so a static file // server is enough to run it in the browser. Skip this call when targeting // a standalone runtime like wasmtime — you don't need the shim then. EnableWasiBrowserRuntime(cfg); return cfg; }