Skip to content

Commit

Permalink
depend on enkiTS source directly via git submodule rather than relyin…
Browse files Browse the repository at this point in the history
…g on its source's becoming available as a product of the box2d cmake build
  • Loading branch information
Birch-san committed Dec 26, 2024
1 parent a8c0069 commit d200b26
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
path = box2cpp
url = https://github.com/Birch-san/box2cpp.git
branch = birch
[submodule "enkiTS"]
path = enkiTS
url = https://github.com/dougbinks/enkiTS.git
13 changes: 12 additions & 1 deletion box2d3-wasm/shell/1_build_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ B2D_WASM_DIR="$(realpath "$DIR/..")"
MONOREPO_DIR="$(realpath "$B2D_WASM_DIR/..")"
BOX2D_DIR="$(realpath "$MONOREPO_DIR/box2d")"
B2CPP_DIR="$(realpath "$MONOREPO_DIR/box2cpp")"
ENKITS_DIR="$(realpath "$MONOREPO_DIR/enkiTS")"
CMAKEBUILD_DIR="$(realpath "$B2D_WASM_DIR/cmake-build")"
BUILD_DIR="$(realpath "$B2D_WASM_DIR/build")"
CSRC_DIR="$(realpath "$B2D_WASM_DIR/csrc")"
Expand Down Expand Up @@ -101,7 +102,17 @@ mkdir -p "$BUILD_DIR"
BARE_WASM="$BUILD_DIR/$BASENAME.bare.wasm"

>&2 echo -e "${Blue}Building bare WASM${NC}"
emcc -lembind "$CSRC_DIR/glue.cpp" "$CSRC_DIR/threading.cpp" "$CSRC_DIR/CanvasDebugDraw.cpp" "$CMAKEBUILD_DIR/_deps/enkits-src/src/TaskScheduler.cpp" "$CMAKEBUILD_DIR/src/libbox2d.a" -I "$BOX2D_DIR/include" -I "$CMAKEBUILD_DIR/_deps/enkits-src/src" -I "$B2CPP_DIR/include" "${EMCC_OPTS[@]}" --oformat=bare -o "$BARE_WASM"
emcc -lembind \
"$CSRC_DIR/glue.cpp" \
"$CSRC_DIR/threading.cpp" \
"$CSRC_DIR/CanvasDebugDraw.cpp" \
"$ENKITS_DIR/src/TaskScheduler.cpp" \
"$CMAKEBUILD_DIR/src/libbox2d.a" \
-I "$BOX2D_DIR/include" \
-I "$ENKITS_DIR/src" \
-I "$B2CPP_DIR/include" \
"${EMCC_OPTS[@]}" \
--oformat=bare -o "$BARE_WASM"
>&2 echo -e "${Blue}Built bare WASM${NC}"

UMD_DIR="$BUILD_DIR/dist/umd"
Expand Down
1 change: 1 addition & 0 deletions enkiTS
Submodule enkiTS added at 686d0e

0 comments on commit d200b26

Please sign in to comment.