diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bec4a48..7c9d1d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,24 +18,8 @@ jobs: linux: name: Linux (Ubuntu) runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Build - run: | - make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y - - name: Stats - run: | - ./qjs -qd - - name: Run built-in tests - run: | - make test - - name: Run microbench - run: | - make microbench + container: + image: gitea.pockle.world/john/prosperon/linux:latest linux-lto: name: Linux LTO @@ -76,29 +60,30 @@ jobs: make CONFIG_M32=y test linux-asan: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Check out + uses: actions/checkout@v4 with: - submodules: true - - name: Build - run: | - make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y - - name: Run built-in tests - env: - ASAN_OPTIONS: halt_on_error=1 - run: | - make CONFIG_ASAN=y test + fetch-depth: 0 - linux-msan: + - name: Test + run: | + meson setup build -Dbuildtype=release -Db_lto=true -Db_ndebug=true + meson test -C build + + windows: + name: Windows (mingw) runs-on: ubuntu-latest + container: + image: gitea.pockle.world/john/prosperon/linux:latest + steps: - - uses: actions/checkout@v4 + - name: Check out + uses: actions/checkout@v4 with: - submodules: true - - name: Build - env: - CC: clang + fetch-depth: 0 + + - name: Test run: | make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_MSAN=y CONFIG_CLANG=y - name: Run built-in tests @@ -283,3 +268,5 @@ jobs: run: docker run --privileged --rm tonistiigi/binfmt:master --install all - name: Run tests on ${{ matrix.platform }} run: docker run --rm --interactive --mount type=bind,source=$(pwd),target=/host --platform ${{ matrix.platform }} alpine sh -c "apk add git patch make gcc libc-dev && cd /host && make test" + meson setup build -Dbuildtype=release -Db_lto=true -Db_ndebug=true --cross-file mingw32.cross + meson test -C build diff --git a/meson.build b/meson.build index a03210a..2b0f731 100644 --- a/meson.build +++ b/meson.build @@ -2,10 +2,13 @@ project('quickjs', 'c') cc = meson.get_compiler('c') +threads = dependency('threads') + deps = [] deps += cc.find_library('m', required:false) +deps += threads -add_project_arguments('-DCONFIG_VERSION="2024-02-14"', language : 'c') +add_project_arguments('-DCONFIG_VERSION="2024-02-14"', '-mcmodel=large', language: 'c') if get_option('bignum') add_project_arguments('-DCONFIG_BIGNUM', language : 'c') @@ -25,8 +28,6 @@ libquickjs = library('quickjs', quickjs_dep = declare_dependency(link_with: libquickjs, include_directories: include_directories('.'), dependencies: deps) -threads = dependency('threads') - qjsc = executable('qjsc', 'qjsc.c', 'quickjs-libc.c', dependencies: [quickjs_dep,threads], diff --git a/mingw32.cross b/mingw32.cross new file mode 100644 index 0000000..af60c54 --- /dev/null +++ b/mingw32.cross @@ -0,0 +1,17 @@ +[binaries] +c = 'x86_64-w64-mingw32-gcc' +cpp = 'x86_64-w64-mingw32-g++' +ar = 'x86_64-w64-mingw32-ar' +windres = 'x86_64-w64-mingw32-windres' +strip = 'x86_64-w64-mingw32-strip' +exe_wrapper = 'wine' +pkg-config = 'pkg-config' + +[host_machine] +system = 'windows' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little' + +[properties] +needs_exe_wrapper = true