]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fixed test failure when Emscripten not present 1739/head
authorCarl Woffenden <cwoffenden@gmail.com>
Tue, 27 Aug 2019 15:12:57 +0000 (17:12 +0200)
committerCarl Woffenden <cwoffenden@gmail.com>
Tue, 27 Aug 2019 15:12:57 +0000 (17:12 +0200)
contrib/declib/build.sh

index 5dd4af96a202f829e195ce94a2b220c6899015fa..9b85c551e01272586cdc5433ecd6a5307cb9cb68 100755 (executable)
@@ -42,16 +42,17 @@ echo "Running simple.c: PASSED"
 which emcc > /dev/null
 if [ $? -ne 0 ]; then
   echo "(Skipping Emscripten test)"
+else
+  # Compile the Emscripten example
+  CC_FLAGS="-Wall -Wextra -Os -g0 -flto --llvm-lto 3 -lGL -DNDEBUG=1"
+  emcc $CC_FLAGS -s WASM=1 -o $OUT_WASM examples/emscripten.c
+  # Did compilation work?
+  if [ $? -ne 0 ]; then
+    echo "Compiling emscripten.c: FAILED"
+    exit 1
+  fi
+  echo "Compiling emscripten.c: PASSED"
+  rm -f $OUT_WASM
 fi
-# Compile the Emscripten example
-CC_FLAGS="-Wall -Wextra -Os -g0 -flto --llvm-lto 3 -lGL -DNDEBUG=1"
-emcc $CC_FLAGS -s WASM=1 -o $OUT_WASM examples/emscripten.c
-# Did compilation work?
-if [ $? -ne 0 ]; then
-  echo "Compiling emscripten.c: FAILED"
-  exit 1
-fi
-echo "Compiling emscripten.c: PASSED"
-rm -f $OUT_WASM
 
 exit 0