From: Benjamin Gilbert Date: Thu, 7 Mar 2024 12:40:27 +0000 (+0900) Subject: meson: don't add -pthread to static linking flags on Windows X-Git-Tag: v1.5.7^2~128^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3931%2Fhead;p=thirdparty%2Fzstd.git meson: don't add -pthread to static linking flags on Windows Meson always returns -pthread in dependency('threads') on non-MSVC compilers. On Windows we use Windows threading primitives, so we don't need this. Avoid adding -pthread to libzstd's link flags, either as a Meson subproject or via pkg-config Libs.private, so the application doesn't inadvertently depend on winpthreads. Add a Meson MinGW cross-compile CI test that checks for this. It turns out that pzstd fails to build in that environment, so have the test skip building contrib for now. --- diff --git a/.github/workflows/dev-short-tests.yml b/.github/workflows/dev-short-tests.yml index 5324b38d9..b8afcb76b 100644 --- a/.github/workflows/dev-short-tests.yml +++ b/.github/workflows/dev-short-tests.yml @@ -237,6 +237,50 @@ jobs: meson test -C builddir/ --print-errorlogs meson install -C builddir --destdir staging/ + meson-mingw-cross-compilation: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v4.1.1 + - name: Install packages + run: | + sudo apt-get -qqq update + sudo apt-get -y install build-essential python3-pip ninja-build {gcc,g++}-mingw-w64-x86-64 + pip install --pre meson + - name: Build with Meson + run: | + cat > cross.ini <