Skip to content

Commit

Permalink
Merge pull request #88 from ceifa/macos-build
Browse files Browse the repository at this point in the history
fix macos build
  • Loading branch information
ceifa authored Aug 11, 2023
2 parents b4bd60d + b5091e2 commit 6785315
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ git submodule update --init # download lua submodule
npm i # install dependencies
```

### Windows / Linux (Docker way)
### Windows / Linux / MacOS (Docker way)

You need to install [docker](https://www.docker.com/) and ensure it is on your `PATH`.

Expand All @@ -170,7 +170,7 @@ npm run build # build the js code/bridge
npm test # ensure everything it's working fine
```

### Ubuntu / Debian
### Ubuntu / Debian / MacOS

You need to install [emscripten](https://emscripten.org/) and ensure it is on your `PATH`.

Expand Down
12 changes: 10 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ else
extension="$extension -O3 --closure 1"
fi

sed -i "s/^#define LUA_32BITS\t0$/#define LUA_32BITS\t1/" ./lua/luaconf.h
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/^#define LUA_32BITS\t0$/#define LUA_32BITS\t1/" ./lua/luaconf.h
else
sed -i "s/^#define LUA_32BITS\t0$/#define LUA_32BITS\t1/" ./lua/luaconf.h
fi

emcc \
-s WASM=1 $extension -o ./build/glue.js \
Expand Down Expand Up @@ -194,4 +198,8 @@ emcc \
]" \
${LUA_SRC}

sed -i "s/^#define LUA_32BITS\t1$/#define LUA_32BITS\t0/" ./lua/luaconf.h
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/^#define LUA_32BITS\t1$/#define LUA_32BITS\t0/" ./lua/luaconf.h
else
sed -i "s/^#define LUA_32BITS\t1$/#define LUA_32BITS\t0/" ./lua/luaconf.h
fi

0 comments on commit 6785315

Please sign in to comment.