Skip to content

Commit

Permalink
CI: Add macOS target to gain clang errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsvensson committed Jul 30, 2024
1 parent 43bf31a commit 9478740
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,27 @@ jobs:
qwprogs.*
compression-level: 9

build-macos:
runs-on: macos-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
run: |
./build_cmake.sh macos
mv build/macos/qwprogs.dylib .
- uses: actions/upload-artifact@v4
with:
name: qwprogs-macos-universal
path: |
qwprogs.dylib
compression-level: 9

upload:
needs: build
needs: [build, build-macos]
timeout-minutes: 10
runs-on: ubuntu-latest
if: github.repository == 'QW-Group/ktx' && ((github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release')
Expand Down
5 changes: 5 additions & 0 deletions build_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ DEFAULT_PLATFORMS=(
windows-x64
windows-x86
qvm
# macos, no cross-compilation
)
PLATFORMS=("${@:-${DEFAULT_PLATFORMS[@]}}")

Expand Down Expand Up @@ -50,6 +51,10 @@ for name in "${PLATFORMS[@]}"; do
cmake -B "${P}" -S . ${BOT_SUPPORT} ${BUILD}
cmake --build "${P}" --target qvm ${V}
;;
"macos" )
cmake -B "${P}" -S . ${BOT_SUPPORT} ${BUILD} -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
cmake --build "${P}" ${V}
;;
* ) # Build native library.
cmake -B "${P}" -S . ${BOT_SUPPORT} ${BUILD} -DCMAKE_TOOLCHAIN_FILE="tools/cross-cmake/${name}.cmake"
cmake --build "${P}" ${V}
Expand Down

0 comments on commit 9478740

Please sign in to comment.