mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Build “fat binaries” for macOS (#1461)
The same binary, both for Intel and ARM Macs! Builds libpng manually since the lib Brew distributes only contains code for the host arch.
This commit is contained in:
17
.github/workflows/testing.yml
vendored
17
.github/workflows/testing.yml
vendored
@@ -22,18 +22,14 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
./.github/scripts/install_deps.sh ${{ matrix.os }}
|
||||
# Export `bison` to allow using the version we install from Homebrew,
|
||||
# instead of the outdated 2.3 one preinstalled on macOS.
|
||||
- name: Build & install using Make
|
||||
if: matrix.buildsys == 'make'
|
||||
run: |
|
||||
export PATH="/opt/homebrew/opt/bison/bin:/usr/local/opt/bison/bin:$PATH"
|
||||
make develop -kj Q= CXX=${{ matrix.cxx }}
|
||||
sudo make install -j Q=
|
||||
- name: Build & install using CMake
|
||||
if: matrix.buildsys == 'cmake'
|
||||
run: |
|
||||
export PATH="/opt/homebrew/opt/bison/bin:/usr/local/opt/bison/bin:$PATH"
|
||||
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DSANITIZERS=ON -DMORE_WARNINGS=ON
|
||||
cmake --build build -j --verbose
|
||||
cp build/src/rgb{asm,link,fix,gfx} .
|
||||
@@ -84,13 +80,12 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
./.github/scripts/install_deps.sh macos
|
||||
# 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`...).
|
||||
- name: Build libpng
|
||||
run: |
|
||||
./.github/scripts/build_libpng.sh
|
||||
- name: Build & install
|
||||
run: |
|
||||
export PATH="/opt/homebrew/opt/bison/bin:/usr/local/opt/bison/bin:$PATH"
|
||||
make -kj CXXFLAGS="-O3 -flto -DNDEBUG -mmacosx-version-min=10.9" PKG_CONFIG="pkg-config --static" PNGLDLIBS="$(pkg-config --static --libs-only-L libpng | cut -c 3-)/libpng.a $(pkg-config --static --libs-only-l libpng | sed s/-lpng[0-9]*//g)" Q=
|
||||
make -kj CXXFLAGS="-O3 -flto -DNDEBUG -mmacosx-version-min=10.9 -arch x86_64 -arch arm64" PNGCFLAGS="-I libpng-staging/include" PNGLDLIBS="libpng-staging/lib/libpng.a -lz" Q=
|
||||
- name: Package binaries
|
||||
run: |
|
||||
mkdir bins
|
||||
@@ -238,13 +233,13 @@ jobs:
|
||||
- name: Install deps
|
||||
shell: bash
|
||||
run: |
|
||||
./.github/scripts/install_deps.sh ${{ matrix.os }}
|
||||
./.github/scripts/install_deps.sh ubuntu
|
||||
- name: Install MinGW
|
||||
run: | # dpkg-dev is apparently required for pkg-config for cross-building
|
||||
sudo apt-get install g++-mingw-w64-${{ matrix.arch }}-win32 mingw-w64-tools libz-mingw-w64-dev dpkg-dev
|
||||
- name: Install libpng dev headers for MinGW
|
||||
run: |
|
||||
sudo ./.github/scripts/mingw-w64-libpng-dev.sh ${{ matrix.triplet }}
|
||||
./.github/scripts/mingw-w64-libpng-dev.sh ${{ matrix.triplet }}
|
||||
- name: Cross-build Windows binaries
|
||||
run: |
|
||||
make mingw${{ matrix.bits }} -kj Q=
|
||||
|
||||
Reference in New Issue
Block a user