UCE Docs / unit_compile

Signature

bool unit_compile(String path = "")

Parameters

path : optional UCE unit path. If empty, recompiles the current executing unit.
return value : true when the host compiler accepted and compiled the unit

Triggers a manual recompile of a UCE compilation unit through the host membrane.

If path is relative, it is resolved by the host unit resolver. The function returns whether compilation succeeded; it does not return or expose a native SharedUnit* to wasm units.

Example

print(unit_compile("examples/sample_unit.uce") ? "compiled the sample unit" : "compile failed", "\n");
Output
compiled the sample unit