From c97882e3ae65a46b08032f76c5473b87059568eb Mon Sep 17 00:00:00 2001 From: wargio Date: Mon, 21 Oct 2024 11:13:18 +0800 Subject: [PATCH] Set `__STDC_NO_ATOMICS__` when msvc does not support c11atomics --- .github/workflows/build-plugin.yml | 7 ++- .../packagefiles/libquickjs/meson.build | 53 ++++++++++--------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build-plugin.yml b/.github/workflows/build-plugin.yml index 1b7ad7a..5f6e7e1 100644 --- a/.github/workflows/build-plugin.yml +++ b/.github/workflows/build-plugin.yml @@ -23,12 +23,15 @@ jobs: - name: Build & run jsdec as rizin plugin run: bash .ci-scripts/ci-build-linux.sh "${{ github.event.pull_request.base.ref || github.ref_name }}" - windows-64: - runs-on: windows-latest + windows-latest: + runs-on: ${{ matrix.os }} name: ${{ matrix.release }} strategy: fail-fast: false matrix: + os: + - "windows-latest" + - "windows-2019" release: - "windows-static" - "windows-shared64" diff --git a/subprojects/packagefiles/libquickjs/meson.build b/subprojects/packagefiles/libquickjs/meson.build index 0dd3a9b..8061d27 100644 --- a/subprojects/packagefiles/libquickjs/meson.build +++ b/subprojects/packagefiles/libquickjs/meson.build @@ -40,30 +40,35 @@ compiler_flags = [ ] if cc.get_id() == 'msvc' - compiler_flags += '-Wno-unsafe-buffer-usage' - compiler_flags += '-Wno-sign-conversion' - compiler_flags += '-Wno-nonportable-system-include-path' - compiler_flags += '-Wno-implicit-int-conversion' - compiler_flags += '-Wno-shorten-64-to-32' - compiler_flags += '-Wno-reserved-macro-identifier' - compiler_flags += '-Wno-reserved-identifier' - compiler_flags += '-Wdeprecated-declarations' - compiler_flags += '/experimental:c11atomics' - compiler_flags += '/wd4018' # -Wno-sign-conversion - compiler_flags += '/wd4061' # -Wno-implicit-fallthrough - compiler_flags += '/wd4100' # -Wno-unused-parameter - compiler_flags += '/wd4200' # -Wno-zero-length-array - compiler_flags += '/wd4242' # -Wno-shorten-64-to-32 - compiler_flags += '/wd4244' # -Wno-shorten-64-to-32 - compiler_flags += '/wd4245' # -Wno-sign-compare - compiler_flags += '/wd4267' # -Wno-shorten-64-to-32 - compiler_flags += '/wd4388' # -Wno-sign-compare - compiler_flags += '/wd4389' # -Wno-sign-compare - compiler_flags += '/wd4710' # Function not inlined - compiler_flags += '/wd4711' # Function was inlined - compiler_flags += '/wd4820' # Padding added after construct - compiler_flags += '/wd4996' # -Wdeprecated-declarations - compiler_flags += '/wd5045' # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified + # c11atomics is required for msvc 22 + if cc.has_argument('/experimental:c11atomics') + add_project_arguments('/experimental:c11atomics', language: 'c') + else + add_project_arguments('-D__STDC_NO_ATOMICS__', language: 'c') + endif + compiler_flags += '-Wno-unsafe-buffer-usage' + compiler_flags += '-Wno-sign-conversion' + compiler_flags += '-Wno-nonportable-system-include-path' + compiler_flags += '-Wno-implicit-int-conversion' + compiler_flags += '-Wno-shorten-64-to-32' + compiler_flags += '-Wno-reserved-macro-identifier' + compiler_flags += '-Wno-reserved-identifier' + compiler_flags += '-Wdeprecated-declarations' + compiler_flags += '/wd4018' # -Wno-sign-conversion + compiler_flags += '/wd4061' # -Wno-implicit-fallthrough + compiler_flags += '/wd4100' # -Wno-unused-parameter + compiler_flags += '/wd4200' # -Wno-zero-length-array + compiler_flags += '/wd4242' # -Wno-shorten-64-to-32 + compiler_flags += '/wd4244' # -Wno-shorten-64-to-32 + compiler_flags += '/wd4245' # -Wno-sign-compare + compiler_flags += '/wd4267' # -Wno-shorten-64-to-32 + compiler_flags += '/wd4388' # -Wno-sign-compare + compiler_flags += '/wd4389' # -Wno-sign-compare + compiler_flags += '/wd4710' # Function not inlined + compiler_flags += '/wd4711' # Function was inlined + compiler_flags += '/wd4820' # Padding added after construct + compiler_flags += '/wd4996' # -Wdeprecated-declarations + compiler_flags += '/wd5045' # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified endif # required on linux, but ignored by windows