Skip to content

Commit 099e8f6

Browse files
committed
emscripten: arm64 macOS is now supported, bump to 4.0.5
1 parent 1c6779f commit 099e8f6

File tree

2 files changed

+13
-22
lines changed

2 files changed

+13
-22
lines changed

emscripten/1_download_library.sh

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ if hash emcc >/dev/null 2>&1; then
2525
else
2626
echo "Preparing portable SDK"
2727

28-
if [ $os = "Darwin" ] ; then
29-
if [ "$(uname -m)" = "arm64" ] ; then
30-
echo "macOS arm64 requires a preinstalled emscripten."
31-
echo "Run 'brew install emscripten' to install it."
32-
exit 1
33-
fi
34-
fi
35-
3628
rm -rf emsdk-portable
3729
git_clone https://github.com/emscripten-core/emsdk.git emsdk-portable
3830

@@ -43,8 +35,8 @@ else
4335
touch .emscripten
4436

4537
# Download and install the latest SDK tools and set up the compiler configuration to point to it.
46-
./emsdk install 3.1.74
47-
./emsdk activate 3.1.74
38+
./emsdk install 4.0.5
39+
./emsdk activate 4.0.5
4840

4941
# Set the current Emscripten path
5042
source ./emsdk_env.sh

emscripten/2_build_toolchain.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ if [ ! -f .patches-applied ]; then
2929
autoreconf -fi
3030
)
3131

32+
# Make wasm32-unknown-emscripten available
33+
(cd $LIBOGG_DIR
34+
autoreconf -fi
35+
)
36+
37+
(cd $LIBVORBIS_DIR
38+
autoreconf -fi
39+
)
40+
3241
# disable unsupported compiler flags by emcc clang in libogg
3342
perl -pi -e 's/-O20/-g0 -O2/g' $LIBOGG_DIR/configure
3443

@@ -68,6 +77,8 @@ function set_build_flags {
6877
export EM_PKG_CONFIG_PATH="$PLATFORM_PREFIX/lib/pkgconfig"
6978
export CMAKE_EXTRA_ARGS="-DCMAKE_FIND_ROOT_PATH=$PLATFORM_PREFIX"
7079

80+
export TARGET_HOST="wasm32-unknown-emscripten"
81+
7182
# force mmap support in mpg123 (actually unused, but needed for building)
7283
export ac_cv_func_mmap_fixed_mapped=yes
7384

@@ -89,12 +100,6 @@ cd $WORKSPACE
89100
# Install libraries
90101
set_build_flags
91102

92-
if [ $os = "Darwin" ] ; then
93-
# Workaround wrong libtool being detected
94-
# Do not use this on Linux, fails with autoconf 2.69
95-
export TARGET_HOST="asmjs-unknown-emscripten"
96-
fi
97-
98103
install_lib_cmake $ZLIB_DIR $ZLIB_ARGS
99104
install_lib_cmake $LIBPNG_DIR $LIBPNG_ARGS
100105
install_lib_cmake $FREETYPE_DIR $FREETYPE_ARGS -DFT_DISABLE_HARFBUZZ=ON
@@ -116,13 +121,7 @@ install_lib_cmake $NLOHMANNJSON_DIR $NLOHMANNJSON_ARGS
116121
install_lib_meson $INIH_DIR $INIH_ARGS
117122
#install_lib $LHASA_DIR $LHASA_ARGS
118123
install_lib_cmake $FMT_DIR $FMT_ARGS
119-
120-
# emscripten TARGET_HOST does not work for all libraries but SDL2 requires it
121-
export TARGET_HOST="asmjs-unknown-emscripten"
122-
rm -f config.cache
123124
install_lib $SDL2_DIR $SDL2_ARGS --disable-assembly --disable-threads --disable-cpuinfo
124-
rm -f config.cache
125-
unset TARGET_HOST
126125

127126
install_lib_icu_cross
128127
icu_force_data_install

0 commit comments

Comments
 (0)