Skip to content

Commit 164563f

Browse files
committed
Merge branch 'intel-mac-builds' into 'master'
[CI] Add intel mac build with separate build step See merge request OpenMW/openmw!4718
2 parents d49a420 + 4938272 commit 164563f

File tree

11 files changed

+159
-94
lines changed

11 files changed

+159
-94
lines changed

.github/workflows/push.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- uses: actions/checkout@v4
7474

7575
- name: Install Building Dependencies
76-
run: CI/before_install.osx.sh
76+
run: CI/before_install.macos.sh
7777

7878
- name: Prime ccache
7979
uses: hendrikmuhs/ccache-action@v1
@@ -82,11 +82,9 @@ jobs:
8282
max-size: 1000M
8383

8484
- name: Configure
85-
run: CI/before_script.osx.sh
85+
run: CI/before_script.macos.sh
8686
- name: Build
87-
run: |
88-
cd build
89-
make -j $(sysctl -n hw.logicalcpu) package
87+
run: CI/macos/build.sh
9088

9189
Output-Envs:
9290
name: Read .env file and expose it as output

.gitlab-ci.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -507,14 +507,15 @@ Ubuntu_GCC_integration_tests_asan:
507507
paths:
508508
- ccache/
509509
script:
510-
- CI/before_install.osx.sh
510+
- CI/before_install.macos.sh
511511
- export CCACHE_BASEDIR="$(pwd)"
512512
- export CCACHE_DIR="$(pwd)/ccache"
513513
- mkdir -pv "${CCACHE_DIR}"
514-
- ccache -z -M "${CCACHE_SIZE}"
515-
- CI/before_script.osx.sh
516-
- cd build; make -j $(sysctl -n hw.logicalcpu) package
517-
- for dmg in *.dmg; do mv "$dmg" "${dmg%.dmg}_${CI_COMMIT_REF_NAME##*/}.dmg"; done
514+
- CI/macos/ccache_prep.sh
515+
- CI/before_script.macos.sh
516+
- CI/macos/build.sh
517+
- cd build
518+
- for dmg in *.dmg; do mv "$dmg" "${dmg%.dmg}_${DMG_IDENTIFIER}_${CI_COMMIT_REF_NAME##*/}.dmg"; done
518519
- |
519520
if [[ -n "${AWS_ACCESS_KEY_ID}" ]]; then
520521
echo "[default]" > ~/.s3cfg
@@ -529,11 +530,23 @@ Ubuntu_GCC_integration_tests_asan:
529530
s3cmd put "${dmg}" s3://openmw-artifacts/${artifactDirectory}
530531
done
531532
fi
532-
- ccache -s
533+
- ../CI/macos/ccache_save.sh
533534
artifacts:
534535
paths:
535536
- build/OpenMW-*.dmg
536537

538+
macOS14_Xcode15_amd64:
539+
extends: .MacOS
540+
image: macos-14-xcode-15
541+
tags:
542+
- saas-macos-medium-m1
543+
cache:
544+
key: macOS14_Xcode15_amd64.v2
545+
variables:
546+
CCACHE_SIZE: 3G
547+
DMG_IDENTIFIER: amd64
548+
MACOS_AMD64: true
549+
537550
macOS14_Xcode15_arm64:
538551
extends: .MacOS
539552
image: macos-14-xcode-15
@@ -542,6 +555,7 @@ macOS14_Xcode15_arm64:
542555
cache:
543556
key: macOS14_Xcode15_arm64.v1
544557
variables:
558+
DMG_IDENTIFIER: arm64
545559
CCACHE_SIZE: 3G
546560

547561
.Compress_And_Upload_Symbols_Base:
@@ -968,7 +982,7 @@ Windows_MSBuild_CacheInit:
968982
- flatpak build-bundle ./repo openmw.flatpak org.openmw.OpenMW.devel
969983
cache:
970984
key: flatpak
971-
paths:
985+
paths:
972986
- ".flatpak-builder"
973987
artifacts:
974988
untracked: false

CI/before_install.macos.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh -ex
2+
3+
export HOMEBREW_NO_EMOJI=1
4+
export HOMEBREW_NO_INSTALL_CLEANUP=1
5+
export HOMEBREW_AUTOREMOVE=1
6+
7+
if [[ "${MACOS_AMD64}" ]]; then
8+
./CI/macos/before_install.amd64.sh
9+
else
10+
./CI/macos/before_install.arm64.sh
11+
fi

CI/before_install.osx.sh

Lines changed: 0 additions & 29 deletions
This file was deleted.

CI/before_script.macos.sh

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/bin/sh -e
2+
3+
# Silence a git warning
4+
git config --global advice.detachedHead false
5+
6+
rm -fr build
7+
mkdir build
8+
cd build
9+
10+
DEPENDENCIES_ROOT="/tmp/openmw-deps"
11+
12+
if [[ "${MACOS_AMD64}" ]]; then
13+
QT_PATH=$(arch -x86_64 /usr/local/bin/brew --prefix qt@6)
14+
ICU_PATH=$(arch -x86_64 /usr/local/bin/brew --prefix icu4c)
15+
OPENAL_PATH=$(arch -x86_64 /usr/local/bin/brew --prefix openal-soft)
16+
CCACHE_EXECUTABLE=$(arch -x86_64 /usr/local/bin/brew --prefix ccache)/bin/ccache
17+
else
18+
QT_PATH=$(brew --prefix qt@6)
19+
ICU_PATH=$(brew --prefix icu4c)
20+
OPENAL_PATH=$(brew --prefix openal-soft)
21+
CCACHE_EXECUTABLE=$(brew --prefix ccache)/bin/ccache
22+
fi
23+
24+
declare -a CMAKE_CONF_OPTS=(
25+
-D CMAKE_PREFIX_PATH="$DEPENDENCIES_ROOT;$QT_PATH;$OPENAL_PATH"
26+
-D CMAKE_C_COMPILER_LAUNCHER="$CCACHE_EXECUTABLE"
27+
-D CMAKE_CXX_COMPILER_LAUNCHER="$CCACHE_EXECUTABLE"
28+
-D CMAKE_CXX_FLAGS="-stdlib=libc++"
29+
-D CMAKE_C_COMPILER="clang"
30+
-D CMAKE_CXX_COMPILER="clang++"
31+
-D CMAKE_OSX_DEPLOYMENT_TARGET="13.6"
32+
-D OPENMW_USE_SYSTEM_RECASTNAVIGATION=TRUE
33+
-D Boost_INCLUDE_DIR="$DEPENDENCIES_ROOT/include"
34+
-D OSGPlugins_LIB_DIR="$DEPENDENCIES_ROOT/lib/osgPlugins-3.6.5"
35+
-D ICU_ROOT="$ICU_PATH"
36+
-D OPENMW_OSX_DEPLOYMENT=TRUE
37+
)
38+
39+
declare -a BUILD_OPTS=(
40+
-D BUILD_OPENMW=TRUE
41+
-D BUILD_OPENCS=TRUE
42+
-D BUILD_ESMTOOL=TRUE
43+
-D BUILD_BSATOOL=TRUE
44+
-D BUILD_ESSIMPORTER=TRUE
45+
-D BUILD_NIFTEST=TRUE
46+
-D BUILD_NAVMESHTOOL=TRUE
47+
-D BUILD_BULLETOBJECTTOOL=TRUE
48+
-G"Unix Makefiles"
49+
)
50+
51+
if [[ "${MACOS_AMD64}" ]]; then
52+
CMAKE_CONF_OPTS+=(
53+
-D CMAKE_OSX_ARCHITECTURES="x86_64"
54+
)
55+
fi
56+
57+
if [[ "${CMAKE_BUILD_TYPE}" ]]; then
58+
CMAKE_CONF_OPTS+=(
59+
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
60+
)
61+
else
62+
CMAKE_CONF_OPTS+=(
63+
-D CMAKE_BUILD_TYPE=RelWithDebInfo
64+
)
65+
fi
66+
67+
if [[ "${MACOS_AMD64}" ]]; then
68+
arch -x86_64 cmake \
69+
"${CMAKE_CONF_OPTS[@]}" \
70+
"${BUILD_OPTS[@]}" \
71+
..
72+
else
73+
cmake \
74+
"${CMAKE_CONF_OPTS[@]}" \
75+
"${BUILD_OPTS[@]}" \
76+
..
77+
fi

CI/before_script.osx.sh

Lines changed: 0 additions & 53 deletions
This file was deleted.

CI/macos/before_install.amd64.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh -ex
2+
3+
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
4+
5+
arch -x86_64 /usr/local/bin/brew install curl xquartz gd fontconfig freetype harfbuzz brotli s3cmd ccache cmake qt@6 openal-soft icu4c yaml-cpp sqlite
6+
7+
curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240802.zip -o ~/openmw-deps.zip
8+
unzip -o ~/openmw-deps.zip -d /tmp > /dev/null

CI/macos/before_install.arm64.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh -ex
2+
3+
brew tap --repair
4+
brew update --quiet
5+
6+
brew install curl xquartz gd fontconfig freetype harfbuzz brotli s3cmd
7+
8+
command -v ccache >/dev/null 2>&1 || brew install ccache
9+
command -v cmake >/dev/null 2>&1 || brew install cmake
10+
command -v qmake >/dev/null 2>&1 || brew install qt@6
11+
12+
# Install deps
13+
brew install openal-soft icu4c yaml-cpp sqlite
14+
15+
curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240818-arm64.tar.xz -o ~/openmw-deps.tar.xz
16+
tar xf ~/openmw-deps.tar.xz -C /tmp > /dev/null

CI/macos/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh -ex
2+
3+
cd build
4+
5+
if [[ "${MACOS_AMD64}" ]]; then
6+
arch -x86_64 make -j $(sysctl -n hw.logicalcpu) package
7+
else
8+
make -j $(sysctl -n hw.logicalcpu) package
9+
fi

CI/macos/ccache_prep.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh -ex
2+
3+
if [[ "${MACOS_AMD64}" ]]; then
4+
arch -x86_64 ccache -z -M "${CCACHE_SIZE}"
5+
else
6+
ccache -z -M "${CCACHE_SIZE}"
7+
fi

0 commit comments

Comments
 (0)