From 998c738ed059127b539dcaef1c2e98b630ee0db1 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Sat, 6 Sep 2025 01:29:44 +0100 Subject: [PATCH] Add some options from the Windows script to the MacOS script Hopefully, they might even work, too. Also move ccache installation to the CI script as it's not mandatory to use ccache for local builds. --- .gitlab-ci.yml | 3 +- CI/before_install.macos.sh | 1 - CI/before_script.macos.sh | 94 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 92 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6960a1d01f..23d94711f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -555,11 +555,12 @@ Ubuntu_GCC_integration_tests_asan: - ccache/ script: - CI/before_install.macos.sh + - brew install ccache - export CCACHE_BASEDIR="$(pwd)" - export CCACHE_DIR="$(pwd)/ccache" - mkdir -pv "${CCACHE_DIR}" - ccache -z -M "${CCACHE_SIZE}" - - CI/before_script.macos.sh + - CI/before_script.macos.sh -C - CI/macos/build.sh - cd build - for dmg in *.dmg; do mv "$dmg" "${dmg%.dmg}_${DMG_IDENTIFIER}_${CI_COMMIT_REF_NAME##*/}.dmg"; done diff --git a/CI/before_install.macos.sh b/CI/before_install.macos.sh index 4d095cdb74..aa87ad9907 100755 --- a/CI/before_install.macos.sh +++ b/CI/before_install.macos.sh @@ -6,5 +6,4 @@ else ./CI/macos/before_install.arm64.sh fi -command -v ccache >/dev/null 2>&1 || brew install ccache command -v cmake >/dev/null 2>&1 || brew install cmake diff --git a/CI/before_script.macos.sh b/CI/before_script.macos.sh index f8c2c74169..67a7e7accf 100755 --- a/CI/before_script.macos.sh +++ b/CI/before_script.macos.sh @@ -1,7 +1,69 @@ #!/bin/bash -e -rm -fr build -mkdir build +VERBOSE="" +USE_CCACHE="" +KEEP="" +USE_WERROR="" + +while [ $# -gt 0 ]; do + ARGSTR=$1 + shift + + if [ ${ARGSTR:0:1} != "-" ]; then + echo "Unknown argument $ARGSTR" + echo "Try '$0 -h'" + wrappedExit 1 + fi + + for (( i=1; i<${#ARGSTR}; i++ )); do + ARG=${ARGSTR:$i:1} + case $ARG in + V ) + VERBOSE=true ;; + + C ) + USE_CCACHE=true ;; + + k ) + KEEP=true ;; + + E ) + USE_WERROR=true ;; + + h ) + cat <