Skip to content

Commit

Permalink
Update build and CMakeLists for macOS universal
Browse files Browse the repository at this point in the history
build
  • Loading branch information
damonto committed Nov 11, 2023
1 parent b9f8cb9 commit 26b4cbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup msys2
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
Expand Down Expand Up @@ -55,9 +55,9 @@ jobs:
- name: Build for macOS
if: runner.os == 'macOS'
run: |
mkdir build && cd build && cmake -DAPPLE_X86_64=ON .. && make -j$(sysctl -n hw.ncpu)
mkdir build && cd build && cmake .. && make -j$(sysctl -n hw.ncpu)
chmod +x output/lpac
zip -r lpac-macos-x86_64.zip output/*
zip -r lpac-macos-universal.zip output/*
shell: bash

- name: Release
Expand All @@ -67,4 +67,4 @@ jobs:
files: |
build/lpac-windows-x86_64.zip
build/lpac-linux-x86_64.tar.gz
build/lpac-macos-x86_64.zip
build/lpac-macos-universal.zip
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
option(LINUX_MINGW32 "Build for windows on Linux" OFF)

if (APPLE_X86_64)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
message(STATUS "Building for macOS x86_64")
if (APPLE)
message(STATUS "Building for macOS")
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
set(CMAKE_SYSTEM_NAME Darwin)
endif()

if(LINUX_MINGW32)
Expand Down

0 comments on commit 26b4cbd

Please sign in to comment.