From bbd5fdfca554a5a774323bc0af8a3cd190b70b87 Mon Sep 17 00:00:00 2001 From: Alex Feldgendler Date: Tue, 25 Aug 2026 19:24:15 +0200 Subject: [PATCH] ci/mac: don't apply werror to the linker for the oldest target Homebrew's libraries are built for the macOS version of the runner, so ld warns for every one of them when the oldest target job builds with a deployment target of 10.15. Those warnings have always been there, but meson 1.12 started passing -Wl,-fatal_warnings along with werror, which turns them into link errors and takes down the whole macOS matrix. Apply werror to the compilers only, which is what the job is after. --- ci/build-macos.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ci/build-macos.sh b/ci/build-macos.sh index eef301e5834d6..49c688887989c 100755 --- a/ci/build-macos.sh +++ b/ci/build-macos.sh @@ -7,6 +7,17 @@ set -e MPV_INSTALL_PREFIX="${HOME}/out/mpv" MPV_VARIANT="${TRAVIS_OS_NAME}" +objc_args="-Wno-error=deprecated -Wno-error=deprecated-declarations" + +# Homebrew's libraries are built for the macOS version of the runner, so ld +# warns for each of them when building for an older deployment target. meson +# 1.12 passes -Wl,-fatal_warnings with werror, so only apply werror to the +# compilers. +if [[ -n "${MACOSX_DEPLOYMENT_TARGET}" ]]; then + common_args="${common_args/--werror/-Dwerror=false -Dc_args=-Werror}" + objc_args="-Werror ${objc_args}" +fi + if [[ -d "./build/${MPV_VARIANT}" ]] ; then rm -rf "./build/${MPV_VARIANT}" fi @@ -14,7 +25,7 @@ fi PKG_CONFIG_PATH="$(brew --prefix libarchive)/lib/pkgconfig/" CC="${CC}" CXX="${CXX}" \ meson setup build $common_args \ -Dprefix="${MPV_INSTALL_PREFIX}" \ - -Dobjc_args="-Wno-error=deprecated -Wno-error=deprecated-declarations" \ + -Dobjc_args="${objc_args}" \ -D{caca,cdda,dvdnav,gl,iconv,lcms2,libarchive,libbluray,lua,jpeg}=enabled \ -D{plain-gl,rubberband,zimg,zlib}=enabled \ -D{cocoa,coreaudio,gl-cocoa,videotoolbox-gl,videotoolbox-pl}=enabled \