Skip to content

Commit

Permalink
Universal Mac OS Binary (#254) (#255)
Browse files Browse the repository at this point in the history
* universal binary support
* update action workflow
  • Loading branch information
avivbeeri authored Mar 3, 2023
1 parent 03808b3 commit ffc441e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.
37 changes: 20 additions & 17 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- name: Verify
run: emcc -v
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v3.0.0
- run: git fetch --prune --unshallow
- run: make MODE=release dome.html ARCH=web
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: dome-web
path: |
Expand All @@ -31,13 +31,13 @@ jobs:
static: [1, 0]
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v3.0.0
- run: git fetch --prune --unshallow
- run: sudo apt-get update
- run: sudo apt-get install build-essential mercurial make cmake autoconf automake libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev libsndio-dev libwayland-dev libxkbcommon-dev
- name: Cache dependancies
if: ${{matrix.static == 1}}
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
./lib/SDL*
Expand All @@ -49,15 +49,15 @@ jobs:
- run: ./scripts/setup_static_linux_sdl.sh
if: ${{matrix.static == 1}}
- run: make MODE=release STATIC=${{matrix.static}}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: ${{matrix.static == 1}}
with:
name: dome-linux-x64
path: |
dome
main.wren
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: ${{matrix.static == 0}}
with:
name: dome-linux-x64-shared
Expand All @@ -69,10 +69,13 @@ jobs:
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
- run: sudo xcode-select -switch /Applications/Xcode_14.2.app/Contents/Developer
uses: actions/checkout@v3.0.0
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.2'
# - run: sudo xcode-select -switch /Applications/Xcode_14.2.app/Contents/Developer
- name: Cache dependancies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
./lib/SDL*
Expand All @@ -81,9 +84,9 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('./scripts/vars.sh') }}-sdl
- run: ./scripts/setup_static_mac_sdl.sh
- run: make MIN_MAC_VERSION=10.12 STATIC=1
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: dome-macosx-x64
name: dome-macosx-all
path: |
dome
main.wren
Expand All @@ -96,7 +99,7 @@ jobs:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
Expand All @@ -112,14 +115,14 @@ jobs:
- run: git fetch --prune --unshallow
- run: gcc -v
- run: "make STATIC=1 TARGET_NAME=dome CC=gcc"
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: ${{ (matrix.msystem == 'MINGW32') }}
with:
name: dome-windows-x32
path: |
dome.exe
main.wren
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: ${{ (matrix.msystem == 'MINGW64') }}
with:
name: dome-windows-x64
Expand Down Expand Up @@ -148,7 +151,7 @@ jobs:
args: zip -qq -r dome-windows-x32.zip dome-windows-x32
- uses: montudor/action-zip@v0.1.0
with:
args: zip -qq -r dome-macosx-x64.zip dome-macosx-x64
args: zip -qq -r dome-macosx-all.zip dome-macosx-all
- uses: montudor/action-zip@v0.1.0
with:
args: zip -qq -r dome-web.zip dome-web
Expand Down Expand Up @@ -195,8 +198,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dome-macosx-x64.zip
asset_name: dome-${{github.event.release.tag_name}}-macosx-x64.zip
asset_path: ./dome-macosx-all.zip
asset_name: dome-${{github.event.release.tag_name}}-macosx-all.zip
asset_content_type: application/zip
- name: Upload Web Engine
uses: actions/upload-release-asset@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/itch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
platform: ["windows-x64", "windows-x32", "macosx-x64", "linux-x64", "linux-x64-shared"]
platform: ["windows-x64", "windows-x32", "macosx-all", "linux-x64", "linux-x64-shared"]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ CFLAGS += -D_XOPEN_SOURCE=500
else ifneq ($(filter macosx,$(TAGS)),)
CFLAGS += -mmacosx-version-min=10.12
CFLAGS += -D_DARWIN_C_SOURCE
CFLAGS += -arch x86_64 -arch arm64
WREN_PARAMS += -arch x86_64 -arch arm64
endif

ifneq ($(filter release,$(TAGS)),)
Expand Down
4 changes: 2 additions & 2 deletions scripts/setup_static_mac_sdl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ git submodule update --init -- $DIRECTORY
if ! [ -d "$DIRECTORY/$FOLDER" ]; then
cd $DIRECTORY
mkdir ${FOLDER} ; cd ${FOLDER}
../configure CC=$(sh $DIRECTORY/build-scripts/clang-fat.sh) # --disable-shared
../configure CC="sh $DIRECTORY/build-scripts/clang-fat.sh" #--disable-shared
else
cd $DIRECTORY/${FOLDER}
cd $DIRECTORY/$FOLDER
fi

make
Expand Down

0 comments on commit ffc441e

Please sign in to comment.