Skip to content

Commit d969c70

Browse files
authored
Support building for osx (#9)
This PR fixes some problems when running the `build-engine.sh` script on osx. I started working on getting an osx debug build that we could cache along with other artifacts on [this branch](https://github.com/fastly/spidermonkey-wasi-embedding/tree/trevor/osx-build-ci), but ran into some issues with [homebrew being required](https://github.com/fastly/spidermonkey-wasi-embedding/actions/runs/3698317793/jobs/6264377216). I split this PR off of that work because it's useful for unblocking building a debug version of spidermonkey on osx, but the process for using it there is still more manual.
1 parent 8b94c53 commit d969c70

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

build-engine.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ cat << EOF > "$mozconfig"
1515
ac_add_options --enable-project=js
1616
ac_add_options --enable-application=js
1717
ac_add_options --target=wasm32-unknown-wasi
18-
ac_add_options --disable-stdcxx-compat
1918
ac_add_options --without-system-zlib
2019
ac_add_options --without-intl-api
2120
ac_add_options --disable-jit
@@ -30,6 +29,22 @@ ac_add_options --prefix=${working_dir}/${objdir}/dist
3029
mk_add_options MOZ_OBJDIR=${working_dir}/${objdir}
3130
EOF
3231

32+
target="$(uname)"
33+
case "$target" in
34+
Linux)
35+
echo "ac_add_options --disable-stdcxx-compat" >> "$mozconfig"
36+
;;
37+
38+
Darwin)
39+
echo "ac_add_options --host=aarch64-apple-darwin" >> "$mozconfig"
40+
;;
41+
42+
*)
43+
echo "Unsupported build target: $target"
44+
exit 1
45+
;;
46+
esac
47+
3348
case "$mode" in
3449
release)
3550
echo "ac_add_options --disable-debug" >> "$mozconfig"

0 commit comments

Comments
 (0)