Skip to content

Commit

Permalink
Merge pull request #215 from boolean-false/main
Browse files Browse the repository at this point in the history
Github Workflow Macos Build
  • Loading branch information
MihailRis committed Jun 4, 2024
2 parents 98abbfd + db729cb commit 6cc95f2
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Macos Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-dmg:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
with:
submodules: 'true'

- name: Install dependencies from brew
run: |
brew install glfw3 glew libpng openal-soft luajit libvorbis
- name: Install specific version of GLM
run: |
curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/5c7655a866646aa4b857c002b8ae5465b9d26f65/Formula/g/glm.rb
brew install --formula glm.rb
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_APPDIR=1

- name: Build
run: cmake --build build -t install

- name: Create DMG
run: |
mkdir VoxelEngineDmgContent
cp -r build/res VoxelEngineDmgContent/
cp -r build/VoxelEngine VoxelEngineDmgContent/
hdiutil create VoxelEngineMacApp.dmg -volname "VoxelEngine" -srcfolder VoxelEngineDmgContent -ov -format UDZO
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: VoxelEngineMacOs
path: VoxelEngineMacApp.dmg
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ if (WIN32)
set(VORBISLIB vorbis vorbisfile) # not tested
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs/glfw)
endif()
elseif(APPLE)
find_package(PkgConfig)
pkg_check_modules(LUAJIT REQUIRED luajit)
pkg_check_modules(VORBIS REQUIRED vorbis vorbisfile)
set(LUA_INCLUDE_DIR "/opt/homebrew/include/luajit-2.1")
set(LUA_LIBRARIES "/opt/homebrew/lib/libluajit-5.1.a")
message(STATUS "LUA Libraries: ${LUA_LIBRARIES}")
message(STATUS "LUA Include Dir: ${LUA_INCLUDE_DIR}")
find_package(PNG REQUIRED)
set(PNGLIB PNG::PNG)
set(VORBISLIB ${VORBIS_LDFLAGS})
message(STATUS "Vorbis Lib: ${VORBIS_LDFLAGS}")
else()
find_package(PkgConfig)
pkg_check_modules(LUAJIT REQUIRED luajit)
Expand Down

0 comments on commit 6cc95f2

Please sign in to comment.