diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4de11d7967..134a6d4033 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -82,7 +82,7 @@ jobs: max-size: 1000M - name: Configure - run: CI/before_script.macos.sh + run: CI/before_script.macos.sh -C - name: Build run: CI/macos/build.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f779c52e44..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}" - - CI/macos/ccache_prep.sh - - CI/before_script.macos.sh + - ccache -z -M "${CCACHE_SIZE}" + - 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 @@ -578,7 +579,7 @@ Ubuntu_GCC_integration_tests_asan: s3cmd put "${dmg}" s3://openmw-artifacts/${artifactDirectory} done fi - - ../CI/macos/ccache_show_stats.sh + - ccache -svv artifacts: paths: - build/OpenMW-*.dmg diff --git a/CI/before_install.macos.sh b/CI/before_install.macos.sh index 60d2d3a38c..84cc99d03d 100755 --- a/CI/before_install.macos.sh +++ b/CI/before_install.macos.sh @@ -1,7 +1,12 @@ #!/bin/sh -ex +brew tap --repair +brew update --quiet + if [[ "${MACOS_AMD64}" ]]; then ./CI/macos/before_install.amd64.sh else ./CI/macos/before_install.arm64.sh fi + +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 15be5eb4e0..67a7e7accf 100755 --- a/CI/before_script.macos.sh +++ b/CI/before_script.macos.sh @@ -1,28 +1,91 @@ -#!/bin/sh -e +#!/bin/bash -e -# Silence a git warning -git config --global advice.detachedHead false +VERBOSE="" +USE_CCACHE="" +KEEP="" +USE_WERROR="" -rm -fr build -mkdir build +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 </dev/null 2>&1 && qmake -v | grep -F 'Using Qt version 6.' >/dev/null || /usr/local/bin/brew install qt@6" + +arch -x86_64 /usr/local/bin/brew install curl xquartz gd fontconfig freetype harfbuzz brotli openal-soft icu4c yaml-cpp sqlite curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240802.zip -o ~/openmw-deps.zip unzip -o ~/openmw-deps.zip -d /tmp > /dev/null diff --git a/CI/macos/before_install.arm64.sh b/CI/macos/before_install.arm64.sh index d1fb572f01..60217093ec 100755 --- a/CI/macos/before_install.arm64.sh +++ b/CI/macos/before_install.arm64.sh @@ -1,11 +1,8 @@ #!/bin/sh -ex -brew tap --repair -brew update --quiet +command -v qmake >/dev/null 2>&1 && qmake -v | grep -F "Using Qt version 6." >/dev/null || brew install qt@6 -command -v cmake >/dev/null 2>&1 || brew install cmake - -brew install curl xquartz gd fontconfig freetype harfbuzz brotli qt@6 ccache openal-soft icu4c yaml-cpp sqlite +brew install curl xquartz gd fontconfig freetype harfbuzz brotli openal-soft icu4c yaml-cpp sqlite curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240818-arm64.tar.xz -o ~/openmw-deps.tar.xz tar xf ~/openmw-deps.tar.xz -C /tmp > /dev/null diff --git a/CI/macos/ccache_prep.sh b/CI/macos/ccache_prep.sh deleted file mode 100755 index abd0103be0..0000000000 --- a/CI/macos/ccache_prep.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -ex - -if [[ "${MACOS_AMD64}" ]]; then - arch -x86_64 ccache -z -M "${CCACHE_SIZE}" -else - ccache -z -M "${CCACHE_SIZE}" -fi diff --git a/CI/macos/ccache_show_stats.sh b/CI/macos/ccache_show_stats.sh deleted file mode 100755 index d7cc48c25e..0000000000 --- a/CI/macos/ccache_show_stats.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -ex - -if [[ "${MACOS_AMD64}" ]]; then - arch -x86_64 ccache -svv -else - ccache -svv -fi