Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI for mac osx #410

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
59 changes: 59 additions & 0 deletions .github/workflows/ci_osx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI OSX

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

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: macos-latest

steps:
- name: Install macOS Tools
run: |
brew update
brew install ninja llvm

- uses: actions/checkout@v3
with:
submodules: recursive

- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: OSX-RELEASE

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSSVOH_HEADLESS_TESTS=1 -GNinja
env:
CC: /usr/local/opt/llvm/bin/clang
CXX: /usr/local/opt/llvm/bin/clang++

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}


- name: Copy artifacts
run: |
cp build/SSVOpenHexagon build/OHWorkshopUploader _RELEASE
cp -r build/_deps/sfml-src/extlibs/libs-osx/Frameworks _RELEASE
install_name_tool -add_rpath Frameworks _RELEASE/SSVOpenHexagon
install_name_tool -add_rpath . _RELEASE/SSVOpenHexagon

- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: OpenHexagon-OSX
path: _RELEASE

- name: Run tests
run: |
mkdir -p build/test
cp _RELEASE/*.dylib build/test
cp -R _RELEASE/Packs build/test
ninja -C build check
23 changes: 18 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ include(${CPM_DOWNLOAD_LOCATION})

set(BUILD_SHARED_LIBS false)
set(SFML_STATIC_LIBRARIES true)
set(SFML_ENABLE_PCH true)
if(NOT APPLE)
set(SFML_ENABLE_PCH true)
endif()

CPMAddPackage(
NAME SFML
Expand All @@ -112,10 +114,12 @@ CPMAddPackage(
)

set_target_properties(sfml-system PROPERTIES UNITY_BUILD ON)
set_target_properties(sfml-window PROPERTIES UNITY_BUILD ON)
set_target_properties(sfml-graphics PROPERTIES UNITY_BUILD ON)
set_target_properties(sfml-audio PROPERTIES UNITY_BUILD ON)
set_target_properties(sfml-network PROPERTIES UNITY_BUILD ON)
if(NOT APPLE)
set_target_properties(sfml-window PROPERTIES UNITY_BUILD ON)
set_target_properties(sfml-graphics PROPERTIES UNITY_BUILD ON)
set_target_properties(sfml-audio PROPERTIES UNITY_BUILD ON)
set_target_properties(sfml-network PROPERTIES UNITY_BUILD ON)
endif()

#
#
Expand Down Expand Up @@ -423,6 +427,13 @@ if(NOT SSVOH_ANDROID)
"${CMAKE_CURRENT_SOURCE_DIR}/_RELEASE/sdkencryptedappticket64.lib"
sodium
)
elseif(APPLE)
set(PUBLIC_LIBRARIES
"${CMAKE_CURRENT_SOURCE_DIR}/_RELEASE/libsteam_api.dylib"
"${CMAKE_CURRENT_SOURCE_DIR}/_RELEASE/discord_game_sdk.dylib"
"${CMAKE_CURRENT_SOURCE_DIR}/_RELEASE/libsdkencryptedappticket.dylib"
sodium
)
else()
set(PUBLIC_LIBRARIES
"${CMAKE_CURRENT_SOURCE_DIR}/_RELEASE/libsteam_api.so"
Expand Down Expand Up @@ -528,6 +539,8 @@ endif()
if(NOT SSVOH_ANDROID)
if(WIN32)
set(STEAM_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/_RELEASE/steam_api64.lib")
elseif(APPLE)
set(STEAM_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/_RELEASE/libsteam_api.dylib")
else()
set(STEAM_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/_RELEASE/libsteam_api.so")
endif()
Expand Down
Binary file added _RELEASE/discord_game_sdk.dylib
Binary file not shown.
Binary file added _RELEASE/libsdkencryptedappticket.dylib
Binary file not shown.
Binary file added _RELEASE/libsteam_api.dylib
Binary file not shown.