Skip to content

Commit 8ed340f

Browse files
committedJun 5, 2023
Added build for macOS.
1 parent a3e1d9c commit 8ed340f

File tree

5 files changed

+62
-5
lines changed

5 files changed

+62
-5
lines changed
 

‎.github/workflows/cibuild.yml

+42-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,48 @@ jobs:
288288
name: SeriousSamAlphaRemake-${{ steps.date.outputs.time }}-bsd-amd64-bin.tar.xz
289289
path: SeriousSamAlphaRemake-${{ steps.date.outputs.time }}-bsd-amd64-bin.tar.xz
290290

291-
291+
build-macos-x64:
292+
name: macOS ${{ matrix.Configuration }} ${{ matrix.Platform }}
293+
runs-on: macos-12
294+
strategy:
295+
fail-fast: false
296+
matrix:
297+
Configuration: [Release]
298+
Platform: [x64]
299+
steps:
300+
- uses: actions/checkout@v3
301+
302+
- name: Get current date
303+
id: date
304+
uses: Kaven-Universe/github-action-current-date-time@v1
305+
with:
306+
format: "YYYYMMDD"
307+
308+
- name: Show current date
309+
run: |
310+
echo "${{ steps.date.outputs.time }}"
311+
312+
- name: Build on macOS
313+
run: |
314+
uname -a
315+
brew install bison flex sdl2 libogg libvorbis zlib-ng cmake vulkan-loader vulkan-headers
316+
cd ${{github.workspace}}/Sources
317+
awk '{sub("-march=native","-mtune=generic")}1' CMakeLists.txt > CmakeTemp.txt && mv CmakeTemp.txt CMakeLists.txt
318+
cat CMakeLists.txt | grep mtune
319+
cmake -B ${{github.workspace}}/Sources/build-x64 -DCMAKE_BUILD_TYPE=${{ matrix.Configuration }} -DTFE=TRUE
320+
cd ${{github.workspace}}/Sources/build-x64
321+
make ecc
322+
make -j$(sysctl -n hw.ncpu || echo 4)
323+
cp -vfr Debug/*.dylib ../../x64/SamTFE/Mods/SSA/Bin
324+
cd ${{github.workspace}}
325+
XZ_DEFAULTS="-T 10" tar --use-compress-program=xz -cpvf SeriousSamAlphaRemake-${{ steps.date.outputs.time }}-macos-amd64-bin.tar.xz x64
326+
327+
- name: Upload artifact
328+
uses: actions/upload-artifact@v3
329+
with:
330+
name: SeriousSamAlphaRemake-${{ steps.date.outputs.time }}-macos-amd64-bin.tar.xz
331+
path: SeriousSamAlphaRemake-${{ steps.date.outputs.time }}-macos-amd64-bin.tar.xz
332+
292333
build-raspios-armv7l:
293334
name: RPi OS Lite ${{ matrix.Configuration }} ${{ matrix.arch }}
294335
runs-on: ubuntu-latest

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Supported OS
109109
### Build status
110110
|CI|Platform|Compiler|Configurations|Platforms|Status|
111111
|---|---|---|---|---|---|
112-
|GitHub Actions|Windows, Ubuntu, FreeBSD, Alpine, Raspberry PI OS Lite|MSVC, GCC, Clang|Release|x86, x64, armv7l, aarch64, riscv64, ppc64le, s390x|![GitHub Actions Build Status](https://github.com/tx00100xt/SeriousSamAlphaRemake/actions/workflows/cibuild.yml/badge.svg)
112+
|GitHub Actions|Windows, Ubuntu, FreeBSD, Alpine, Raspberry PI OS Lite, macOS|MSVC, GCC, Clang|Release|x86, x64, armv7l, aarch64, riscv64, ppc64le, s390x|![GitHub Actions Build Status](https://github.com/tx00100xt/SeriousSamAlphaRemake/actions/workflows/cibuild.yml/badge.svg)
113113

114114
You can download a the automatically build based on the latest commit.
115115
To do this, go to the [Actions tab], select the top workflows, and then Artifacts.

‎Sources/CMakeLists.txt

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
cmake_minimum_required(VERSION 2.8.12)
22
project(SeriousEngine)
33

4+
# set minimal standart
5+
set(CMAKE_CXX_STANDARD 14)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
48
# Set @rpath for Mac OS X shared library install names.
59
#cmake_policy(SET CMP0042 NEW)
610

@@ -9,7 +13,6 @@ option(USE_SYSTEM_SDL2 "Use systems sdl2 development files" On)
913
option(USE_SYSTEM_ZLIB "Use systems zlib development files" On)
1014
option(USE_CCACHE "Set to ON to use ccache if present in the system" ${USE_CCACHE})
1115

12-
1316
# fallback for cmake versions without add_compile_options # RAKE! Borrowed from dhewm3 project
1417
if(NOT COMMAND add_compile_options)
1518
function(add_compile_options)
@@ -94,6 +97,12 @@ if(MSVC)
9497
SET(WINDOWS TRUE)
9598
endif()
9699

100+
# remove clang spam.
101+
if(MACOSX OR FREEBSD)
102+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-nullability-completeness")
103+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nullability-completeness")
104+
endif()
105+
97106
if(NOT CMAKE_BUILD_TYPE)
98107
set(CMAKE_BUILD_TYPE Debug CACHE STRING "None Debug Release RelWithDebInfo MinSizeRel" FORCE)
99108
endif()
@@ -193,12 +202,13 @@ message(STATUS "Installed libraries dir: ${CMAKE_INSTALL_LIBDIR}")
193202
## ** RAKE! clean up for SeriousEngine use. Also **
194203
## ** RAKE! need to make this pandora safe. **
195204
# compiler specific flags
196-
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
205+
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
197206
# This section and the like are for flags/defines that can be shared between
198207
# c and c++ compile options
199208
add_compile_options(-Wall)
200209
add_compile_options(-pipe)
201210
add_compile_options(-fPIC)
211+
add_compile_options(-fms-extensions)
202212
if(NOT PANDORA AND NOT PYRA AND NOT RPI4 AND NOT (MACOSX AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"))
203213
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "riscv64")
204214
add_compile_options(-march=rv64gc)
@@ -322,6 +332,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
322332
add_definitions(-DPLATFORM_UNIX=1)
323333
add_definitions(-DPLATFORM_MACOSX=1)
324334
add_definitions(-DPRAGMA_ONCE=1)
335+
include_directories("/usr/local/include")
336+
include_directories("/usr/X11/include/")
325337
elseif(WINDOWS)
326338
add_definitions(-DPLATFORM_WIN32=1)
327339
add_definitions(-DPRAGMA_ONCE=1)

‎Sources/Engine/Base/Types.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,10 @@ MY_STATIC_ASSERT(size_tSize, sizeof(size_t) == sizeof(void*));
297297
}
298298

299299
typedef uint64_t __uint64;
300-
#if (!defined __INTEL_COMPILER)
300+
#if (!defined __INTEL_COMPILER) && (!defined PLATFORM_FREEBSD) && (!defined PLATFORM_MACOSX)
301301
typedef int64_t __int64;
302+
#elif (!defined PLATFORM_FREEBSD) && (!defined PLATFORM_MACOSX)
303+
typedef long long int // #define __INT64_TYPE__ long long int
302304
#endif
303305

304306
typedef char CHAR;

‎Sources/Engine/Engine.h

+2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
3131
#endif
3232

3333
#include <stdlib.h>
34+
#if (!defined __INTEL_COMPILER) && (!defined PLATFORM_MACOSX)
3435
#include <malloc.h>
36+
#endif
3537
#include <stdarg.h>
3638
#include <stdio.h>
3739
#include <string.h>

0 commit comments

Comments
 (0)
Please sign in to comment.