Skip to content

Commit

Permalink
CI for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
rollerozxa committed May 11, 2024
1 parent 2da509a commit 76c67b4
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: macos

on:
push:
paths:
- 'src/**'
- 'data-*/**'
- 'packaging/**'
- 'CMakeLists.txt'
- '.github/workflows/macos.yml'
pull_request:
paths:
- 'src/**'
- 'data-*/**'
- 'packaging/**'
- 'CMakeLists.txt'
- '.github/workflows/macos.yml'

jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Install deps
run: |
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_INSTALL_CLEANUP=1
brew update --auto-update
brew install cmake ninja glew libpng libjpeg-turbo freetype sdl2 gtk+3
patch /opt/homebrew/include/GL/glew.h < packaging/glew_macos_fix.patch
- name: Compile
run: |
mkdir build; cd build
cmake .. -G Ninja \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DCMAKE_INSTALL_PREFIX=../build/macos/ \
-DCMAKE_EXE_LINKER_FLAGS="-L/opt/homebrew/lib/" \
-DGLEW_LIBRARY_RELEASE=/opt/homebrew/lib/libGLEW.dylib
ninja
- name: Package
run: |
cd build
ninja package
- name: Upload output as artifact
uses: actions/upload-artifact@v4
with:
name: principia-macos
path: build/*.zip
21 changes: 21 additions & 0 deletions packaging/glew_macos_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- glew.h 2022-11-15 14:16:27.000000000 +0100
+++ glew_mod.h 2024-05-11 17:12:43.597037795 +0200
@@ -220,13 +220,13 @@
*/

#if defined(__APPLE__) || defined(__linux__)
-# if defined(__cplusplus)
-# include <cstddef>
-# include <cstdint>
-# else
+//# if defined(__cplusplus)
+//# include <cstddef>
+//# include <cstdint>
+//# else
# include <stddef.h>
# include <stdint.h>
-# endif
+//# endif
#else

# include <stddef.h>

0 comments on commit 76c67b4

Please sign in to comment.