update quickjs to 2023-12-09 #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: QuickJS MinGW DLL build | |
on: | |
push: | |
paths: | |
- 'quickjs/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
cflags: [ "-flto -O2 -DNDEBUG", "-flto -Os -DNDEBUG", "-flto -O3 -DNDEBUG", "-O3 -DNDEBUG", "-g -DDUMP_LEAKS=1" ] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: install mingw | |
run: sudo apt-get update ; sudo apt-get install -y mingw-w64 | |
- name: build dlls | |
run: | | |
mkdir -p bin | |
# generate def file | |
gcc -shared quickjs/*.c -DCONFIG_VERSION=\"$(cat quickjs/VERSION)\" -DCONFIG_BIGNUM -D_GNU_SOURCE=1 -fPIC -o libquickjs.so | |
# export only symbols with "js" in them | |
echo 'EXPORTS' > bin/libquickjs.def | |
nm -D --defined-only -f posix libquickjs.so | grep -i js | awk '{print $1}' >> bin/libquickjs.def | |
i686-w64-mingw32-gcc -shared -static quickjs/*.c bin/libquickjs.def -DCONFIG_VERSION=\"$(cat quickjs/VERSION)\" -DCONFIG_BIGNUM -D_GNU_SOURCE=1 -o bin/libquickjs32.dll -Wl,--out-implib,bin/libquickjs32.a -pthread -s ${{ matrix.cflags }} | |
x86_64-w64-mingw32-gcc -shared -static quickjs/*.c bin/libquickjs.def -DCONFIG_VERSION=\"$(cat quickjs/VERSION)\" -DCONFIG_BIGNUM -D_GNU_SOURCE=1 -o bin/libquickjs64.dll -Wl,--out-implib,bin/libquickjs64.a -pthread -s ${{ matrix.cflags }} | |
shell: bash | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: dlls ${{matrix.cflags}} | |
path: bin |