Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ jobs:
echo "EM_CONFIG=$EM_CONFIG" >> $GITHUB_ENV
echo "$EMSDK:$EMSDK/upstream/emscripten" >> $GITHUB_PATH

- name: Cache emscripten build products
id: cache-emscripten
uses: actions/cache@v5
env:
cache-name: emscripten-cache
with:
path: ${{ env.EMSDK }}/upstream/emscripten/cache
key: ${{ runner.os }}-${{ env.cache-name }}-${{ inputs.emsdk_version }}

- if: ${{ steps.cache-emscripten.outputs.cache-hit }} == 'true'
name: Run emscripten sanity check after restoring cache
run: |
source "$EMSDK/emsdk_env.sh"
emcc --check
exit $?

- name: Build TS App
run: |
source "$EMSDK/emsdk_env.sh"
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ opus-wasmlib: $(LIBOPUS_WASM_LIB)

# common EMCC options
define EMCC_OPTS
-O2 \
-O3 \
-msimd128 \
-flto \
--minify 0 \
-gsource-map \
-s WASM=1 \
Expand Down Expand Up @@ -109,9 +110,11 @@ $(LIBOPUS_WASM_LIB): $(LIBOPUS_BUILD)/Makefile

libopus-configure: $(LIBOPUS_BUILD)/Makefile

$(LIBOPUS_BUILD)/Makefile: $(LIBOPUS_SRC)/configure
$(LIBOPUS_BUILD)/Makefile: $(LIBOPUS_SRC)/configure
mkdir -p $(LIBOPUS_BUILD)
cd $(LIBOPUS_BUILD); CFLAGS="-O3 -msimd128" emconfigure $(CURDIR)/$(LIBOPUS_SRC)/configure \
cd $(LIBOPUS_BUILD); \
CFLAGS="-O3 -msimd128 -flto" \
emconfigure $(CURDIR)/$(LIBOPUS_SRC)/configure \
--host=wasm32-unknown-emscripten \
--enable-float-approx \
--disable-rtcd \
Expand Down