Skip to content

Commit 104a7a5

Browse files
authored
Build macOS universal binary (x86_64 + arm64) (#178)
* Build macOS universal binary (x86_64 + arm64) Now that BASS is removed, we can build universal binaries that run natively on both Intel and Apple Silicon Macs. Changes: - Update CMAKE_OSX_ARCHITECTURES to include both x86_64 and arm64 - Update release workflow to explicitly build universal binary - Add verification step to confirm both architectures are present - Rename release artifact to RocketEditor-macOS-universal.zip * Fix strict-prototypes warning in minimp3.h for macOS
1 parent f70fea8 commit 104a7a5

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@ jobs:
1515
submodules: true
1616

1717
- name: Configure
18-
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
18+
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
1919

2020
- name: Build
2121
run: cmake --build build --parallel
2222

23+
- name: Verify universal binary
24+
run: |
25+
file build/RocketEditor.app/Contents/MacOS/RocketEditor
26+
lipo -info build/RocketEditor.app/Contents/MacOS/RocketEditor
27+
2328
- name: Package
2429
run: |
2530
cd build
26-
zip -r RocketEditor-macOS.zip RocketEditor.app
31+
zip -r RocketEditor-macOS-universal.zip RocketEditor.app
2732
2833
- name: Upload artifact
2934
uses: actions/upload-artifact@v4
3035
with:
3136
name: RocketEditor-macOS
32-
path: build/RocketEditor-macOS.zip
37+
path: build/RocketEditor-macOS-universal.zip
3338

3439
build_windows:
3540
runs-on: windows-latest
@@ -78,5 +83,5 @@ jobs:
7883
uses: softprops/action-gh-release@v1
7984
with:
8085
files: |
81-
RocketEditor-macOS.zip
86+
RocketEditor-macOS-universal.zip
8287
RocketEditor-Windows.zip

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ project(RocketEditor)
22

33
cmake_minimum_required(VERSION 3.5...3.28)
44

5-
set(CMAKE_OSX_ARCHITECTURES x86_64)
5+
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
66

77
set(RKT_EXE_NAME "RocketEditor")
88
set(EXAMPLE_NAME "BasicExample")

external/minimp3/minimp3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static int have_simd(void)
176176
#define VMUL_S(x, s) vmulq_f32(x, vmovq_n_f32(s))
177177
#define VREV(x) vcombine_f32(vget_high_f32(vrev64q_f32(x)), vget_low_f32(vrev64q_f32(x)))
178178
typedef float32x4_t f4;
179-
static int have_simd()
179+
static int have_simd(void)
180180
{ /* TODO: detect neon for !MINIMP3_ONLY_SIMD */
181181
return 1;
182182
}

0 commit comments

Comments
 (0)