diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9cc7b3f4c1e163de20e3f16aed3afe563bad4e5f..233406fcd7f057f878ceaf3b6cfbd67b3867628b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -48,6 +48,9 @@ build_macos_x86_64:
   tags:
     - macOS
   script:
+    # Workaround for bug in Xcode 15.3 which does not include m4
+    # See https://github.com/Homebrew/homebrew-core/issues/165388 and https://trac.macports.org/ticket/69639
+    - export PATH="/usr/local/opt/m4/bin/:$PATH"
     - arch -x86_64 meson setup -D buildtype=release --native-file scripts/homebrew-native-x86_64.ini build
     - arch -x86_64 meson compile -C build -v
   artifacts:
@@ -60,6 +63,9 @@ build_macos_arm64:
     - macOS
   script:
     - export PATH="/opt/homebrew/bin:$PATH"
+    # Workaround for bug in Xcode 15.3 which does not include m4
+    # See https://github.com/Homebrew/homebrew-core/issues/165388 and https://trac.macports.org/ticket/69639
+    - export PATH="/opt/homebrew/opt/m4/bin/:$PATH"
     - arch -arm64 meson setup -D buildtype=release --native-file scripts/homebrew-native-arm64.ini build
     - arch -arm64 meson compile -C build -v
   artifacts: