From 15256058a6fd185ee2173634e4811dcc8448520d Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Wed, 15 May 2024 14:14:24 +0200 Subject: [PATCH] Display error if stubs not compiled --- wasmrt.nim | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wasmrt.nim b/wasmrt.nim index b5d9641..29f9415 100644 --- a/wasmrt.nim +++ b/wasmrt.nim @@ -731,5 +731,13 @@ static: discard staticExec("mkdir " & nimcache) else: discard staticExec("mkdir -p " & nimcache) - discard staticExec(compilerPath & " -c --target=wasm32-unknown-unknown-wasm -o " & nimcache & "/libm.a -x c -", input = "\n") - discard staticExec(compilerPath & " -c --target=wasm32-unknown-unknown-wasm -o " & nimcache & "/librt.a -x c -", input = "\n") + let (o1, r1) = gorgeEx(compilerPath & " -c --target=wasm32-unknown-unknown-wasm -o " & nimcache & "/libm.a -x c -", input = "\n") + if r1 != 0: + echo "Error compiling libm stub:" + echo o1 + doAssert(false) + let (o2, r2) = gorgeEx(compilerPath & " -c --target=wasm32-unknown-unknown-wasm -o " & nimcache & "/librt.a -x c -", input = "\n") + if r2 != 0: + echo "Error compiling librt stub:" + echo o2 + doAssert(false)