Skip to content

Commit

Permalink
Merge pull request #51 from openscad/ochafik-patch-2
Browse files Browse the repository at this point in the history
fix build-openscad-wasm.sh
  • Loading branch information
ochafik authored Jul 18, 2024
2 parents 71c629c + 6ced96a commit 3010320
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions build-openscad-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euo pipefail

if [ -z "${OPENSCAD_DIR:-}" ]; then
OPENSCAD_DIR=/tmp/openscad-color
OPENSCAD_DIR=~/tmp/openscad-color
if [ ! -d "$OPENSCAD_DIR" ]; then
rm -fR "$OPENSCAD_DIR"
git clone --recurse https://github.com/ochafik/openscad.git \
Expand All @@ -11,16 +11,15 @@ if [ -z "${OPENSCAD_DIR:-}" ]; then
fi
fi

( cd "$OPENSCAD_DIR" &&
docker run --rm -it -v "$PWD":/src:rw --platform=linux/amd64 openscad/wasm-base:latest \
emcmake cmake -B build -DEXPERIMENTAL=ON "$@" && \
docker run --rm -it -v "$PWD":/src:rw --platform=linux/amd64 openscad/wasm-base:latest \
cmake --build build -j10 )
docker run --rm -it -v "$OPENSCAD_DIR":/src:rw --platform=linux/amd64 openscad/wasm-base:latest \
emcmake cmake -B build -DEXPERIMENTAL=ON "$@" && \
docker run --rm -it -v "$OPENSCAD_DIR":/src:rw --platform=linux/amd64 openscad/wasm-base:latest \
cmake --build build -j10

rm -fR libs/openscad-wasm
mkdir -p libs/openscad-wasm

cp "$OPENSCAD_DIR/build/openscad.wasm" libs/openscad-wasm/
cp "$OPENSCAD_DIR/build/openscad.js" libs/openscad-wasm/
cp "$OPENSCAD_DIR/build/openscad.wasm.map" libs/openscad-wasm/ || true
( cd libs && zip -r ../dist/openscad-wasm.zip openscad-wasm )
( cd libs && zip -r ../dist/openscad-wasm.zip openscad-wasm )

0 comments on commit 3010320

Please sign in to comment.