Skip to content

Commit 4e171d8

Browse files
committed
CI: Add macOS target to gain clang errors.
1 parent fe38404 commit 4e171d8

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,27 @@ jobs:
9191
qwprogs.*
9292
compression-level: 9
9393

94+
build-macos:
95+
runs-on: macos-latest
96+
timeout-minutes: 10
97+
steps:
98+
- name: Checkout
99+
uses: actions/checkout@v4
100+
101+
- name: Build
102+
run: |
103+
./build_cmake.sh macos
104+
mv build/macos/qwprogs.dylib .
105+
106+
- uses: actions/upload-artifact@v4
107+
with:
108+
name: qwprogs-macos-universal
109+
path: |
110+
qwprogs.dylib
111+
compression-level: 9
112+
94113
upload:
95-
needs: build
114+
needs: [build, build-macos]
96115
timeout-minutes: 10
97116
runs-on: ubuntu-latest
98117
if: github.repository == 'QW-Group/ktx' && ((github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release')

build_cmake.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ DEFAULT_PLATFORMS=(
1515
windows-x64
1616
windows-x86
1717
qvm
18+
# macos, no cross-compilation
1819
)
1920
PLATFORMS=("${@:-${DEFAULT_PLATFORMS[@]}}")
2021

@@ -50,6 +51,10 @@ for name in "${PLATFORMS[@]}"; do
5051
cmake -B "${P}" -S . ${BOT_SUPPORT} ${BUILD}
5152
cmake --build "${P}" --target qvm ${V}
5253
;;
54+
"macos" )
55+
cmake -B "${P}" -S . -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" ${BOT_SUPPORT} ${BUILD}
56+
cmake --build "${P}" ${V}
57+
;;
5358
* ) # Build native library.
5459
cmake -B "${P}" -S . ${BOT_SUPPORT} ${BUILD} -DCMAKE_TOOLCHAIN_FILE="tools/cross-cmake/${name}.cmake"
5560
cmake --build "${P}" ${V}

0 commit comments

Comments
 (0)