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

Mac Universal Binary #658

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,11 @@ jobs:
cc: cl
cxx: cl
name: Windows-x64
- runner: macos-14 # Apple Silicon, but we cross-compile
- runner: macos-14 # Apple Silicon, but we make a universal binary
preset: mac
cc: cc
cxx: c++
name: macOS-Intel
- runner: macos-14 # Apple Silicon
preset: mac
cc: cc
cxx: c++
name: macOS-ARM
name: macOS
- runner: ubuntu-latest
preset: linux
cc: gcc
Expand Down Expand Up @@ -61,18 +56,22 @@ jobs:
submodules: recursive

- name: Install macOS Rosetta 2
if: ${{ matrix.os.name == 'macOS-Intel' }}
if: ${{ matrix.os.preset == 'mac' }}
run: /usr/sbin/softwareupdate --install-rosetta --agree-to-license

- name: Install macOS ARM dependencies
if: ${{ matrix.os.preset == 'mac' }}
run: brew bundle install

- name: Install Intel version of Brew
if: ${{ matrix.os.name == 'macOS-Intel' }}
if: ${{ matrix.os.preset == 'mac' }}
shell: arch -x86_64 /bin/bash -e {0}
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/usr/local/bin/brew shellenv)" # makes the Intel version of Brew and its installs are enshrined as the default
echo "PATH=$PATH" >> $GITHUB_ENV # modify $PATH so the above step persists into the future steps

- name: Install macOS dependencies
- name: Install macOS Intel dependencies
if: ${{ matrix.os.preset == 'mac' }}
run: brew bundle install

Expand All @@ -99,6 +98,7 @@ jobs:
arch: win64

- uses: lukka/run-vcpkg@v11
if: ${{ matrix.os.preset != 'mac' }}
with:
vcpkgJsonGlob: vcpkg.json

Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
message("Building for MAC OSX")
add_compile_definitions(POSIX MACOSX=1 _USE_OGL_ACTIVE_TEXTURES PRIMARY_HOG=\"d3-osx.hog\")
set(PLATFORM_INCLUDES "lib/linux" ${SDL2_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS})
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# Windows.h defines to avoid as many issues as possible.
add_compile_definitions(WIN32_LEAN_AND_MEAN NOMINMAX NODRAWTEXT NOBITMAP NOMCX NOSERVICE PRIMARY_HOG=\"d3-win.hog\"
Expand Down
Loading