mirror of
https://github.com/gbdev/rgbds.git
synced 2026-05-08 10:59:36 +00:00
Target an even older version of Mac OS X
We can, so let's not ask if we should! More realistically, we can right now so it's nice to mark that we do, but this is subject to be re-evaluated if any later changes conflicts with this. Note also that this only affects the binaries we distribute with our releases! It may very well be possible to compile RGBDS on even older versions of Mac OS X if you have the appropriate compiler setup; we're just not testing it nor offering such binaries ourselves, but third-party packagers are welcome to do so. (Looking at you, TigerBrew! ;)
This commit is contained in:
@@ -30,10 +30,18 @@ case "${OS%%-*}" in
|
|||||||
sudo apt-get install -yq $pkgs
|
sudo apt-get install -yq $pkgs
|
||||||
;;
|
;;
|
||||||
macos)
|
macos)
|
||||||
|
pkgs=bison
|
||||||
|
case $TOOLSET in
|
||||||
|
'' | lld)
|
||||||
|
pkgs="$pkgs $TOOLSET"
|
||||||
|
TOOLSET=
|
||||||
|
;;
|
||||||
|
esac
|
||||||
# macOS bundles GNU Make 3.81, which doesn't support synced output.
|
# macOS bundles GNU Make 3.81, which doesn't support synced output.
|
||||||
# We leave it as the default in `PATH`, to test that our Makefile works with it.
|
# We leave it as the default in `PATH`, to test that our Makefile works with it.
|
||||||
# However, CMake automatically uses Homebrew's `gmake`, so our CI has synced output.
|
# However, CMake automatically uses Homebrew's `gmake`, so our CI has synced output.
|
||||||
brew install bison make
|
# shellcheck disable=SC2086 # (This word splitting is intentional.)
|
||||||
|
brew install $pkgs make
|
||||||
# Export `bison` to allow using the version we install from Homebrew,
|
# Export `bison` to allow using the version we install from Homebrew,
|
||||||
# instead of the outdated one preinstalled on macOS (which doesn't even support `-Wall`...).
|
# instead of the outdated one preinstalled on macOS (which doesn't even support `-Wall`...).
|
||||||
export PATH="$(brew --prefix)/opt/bison/bin:$PATH"
|
export PATH="$(brew --prefix)/opt/bison/bin:$PATH"
|
||||||
|
|||||||
@@ -57,12 +57,14 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: |
|
run: |
|
||||||
./.github/scripts/install_deps.sh macos
|
./.github/scripts/install_deps.sh macos lld
|
||||||
- name: Build binaries
|
- name: Build binaries
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B build --preset macos-static -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}"
|
cmake -S . -B build --preset macos-static -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}"
|
||||||
cmake --build build
|
cmake --build build
|
||||||
strip rgb{asm,link,fix,gfx}
|
strip rgb{asm,link,fix,gfx}
|
||||||
|
env:
|
||||||
|
LDFLAGS: -fuse-ld=lld # cmake/macos-static.cmake comments explain why we use lld.
|
||||||
- name: Package binaries
|
- name: Package binaries
|
||||||
run: |
|
run: |
|
||||||
zip --junk-paths rgbds-macos.zip rgb{asm,link,fix,gfx} man/* .github/scripts/install.sh
|
zip --junk-paths rgbds-macos.zip rgb{asm,link,fix,gfx} man/* .github/scripts/install.sh
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: |
|
run: |
|
||||||
.github/scripts/install_deps.sh macos
|
.github/scripts/install_deps.sh macos lld
|
||||||
- name: Cache library deps
|
- name: Cache library deps
|
||||||
uses: actions/cache@v5
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
@@ -124,6 +124,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cmake -S . -B build --preset macos-static -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}" -DTESTS_OS_NAME=macos
|
cmake -S . -B build --preset macos-static -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}" -DTESTS_OS_NAME=macos
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
env:
|
||||||
|
LDFLAGS: -fuse-ld=lld # cmake/macos-static.cmake comments explain why we use lld.
|
||||||
- name: Package binaries
|
- name: Package binaries
|
||||||
run: |
|
run: |
|
||||||
mkdir bins
|
mkdir bins
|
||||||
|
|||||||
@@ -2,10 +2,14 @@
|
|||||||
# in order to generate executables compatible with old macOS versions.
|
# in order to generate executables compatible with old macOS versions.
|
||||||
# See our `macos-static` CMake preset for how it's meant to be used.
|
# See our `macos-static` CMake preset for how it's meant to be used.
|
||||||
|
|
||||||
# The `-mmacosx-version-min=10.9` flag ensures that the binary only uses APIs available on Mac OS X 10.9 Mavericks.
|
# Note that targeting old enough versions of Mac OS X on recent enough versions of macOS
|
||||||
|
# triggers some poorly-tested code paths within Apple's linker, which then crashes.
|
||||||
|
# This can be worked around by using LLVM's LLD linker and passing `-fuse-ld=lld` when linking.
|
||||||
|
|
||||||
|
# The `-mmacosx-version-min=10.4` flag ensures that the binary only uses APIs available on Mac OS X 10.4 Tiger.
|
||||||
# The `-arch` flags build a "fat binary" that works on both Apple architectures:
|
# The `-arch` flags build a "fat binary" that works on both Apple architectures:
|
||||||
# older Intel x64 Macs and newer ARM "Apple Silicon" ones.
|
# older Intel x64 Macs and newer ARM "Apple Silicon" ones.
|
||||||
set(secret_sauce -mmacosx-version-min=10.9 "SHELL:-arch x86_64" "SHELL:-arch arm64") # Avoid `-arch` being dedup'd.
|
set(secret_sauce -mmacosx-version-min=10.4 "SHELL:-arch x86_64" "SHELL:-arch arm64") # Avoid `-arch` being dedup'd.
|
||||||
add_compile_options(${secret_sauce})
|
add_compile_options(${secret_sauce})
|
||||||
add_link_options(${secret_sauce})
|
add_link_options(${secret_sauce})
|
||||||
set(PNG_HARDWARE_OPTIMIZATIONS OFF) # These do not play well with a dual-arch build.
|
set(PNG_HARDWARE_OPTIMIZATIONS OFF) # These do not play well with a dual-arch build.
|
||||||
|
|||||||
Reference in New Issue
Block a user