Make wasm2c native build portably discover runtime and OpenSSL

Add native/build_native.py to auto-discover WABT's wasm2c runtime headers and sources (wasm-rt.h, wasm-rt-*.c, and .inc files, with WASM2C_RUNTIME_DIR override) and OpenSSL flags across Linux distros and macOS, instead of assuming /usr/include/wasm-rt.h and -lwasm-rt-impl. Guard _DARWIN_C_SOURCE vs _POSIX_C_SOURCE in native/wasi_host.c, delegate just native to native/build_native.py, and document WASM2C_RUNTIME_DIR in README.md.
This commit is contained in:
Sprite committed 2026-11-20 00:22:20 +00:00
1 parent 2ff249ff89
commit dba2cbcdca
4 files changed
+232 -8

No files matched your search

+2
View File
@@ -37,6 +37,8 @@ just run-native -fsSI https://example.com
just test-native
```
If WABT's `wasm2c` runtime sources (`wasm-rt.h` and `wasm-rt-impl.c`) live in a non-standard path, set `WASM2C_RUNTIME_DIR=/path/to/wabt/wasm2c`.
## Supported Options
| Option | Description |