-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add macOS SDL to thirdparty, add .dylib to bundle (#1345)
### Description Adds SDL (properly) to Mac builds. This time, it has been added as a fully fledged optional dependency in `thirdparty`, à la MoltenVK, and built from source before ares. We build from source because brew installations are both single-architecture and not fully portable. The .dylib is copied inside the app bundle when linking, at the same stage as MoltenVK. The initialization of `ares.dylibs` has been moved from ares's Makefile to the `desktop-ui` Makefile so that it's initialized when building ruby, which it wasn't previously. The SDL build is also added to CI, with the same caching methods as used for MVK. ### Relevant Details `HEAD` points at SDL 2.28.5 currently, which is the most recent stable release. This should probably be periodically incremented as appropriate. ~~SDL is currently built with the macOS deployment target of 10.13. While SDL's minimum supported macOS version is 10.11, ares CI is using Xcode 14.2, which has a minimum deployment target of 10.13. I am currently testing to see if I can get the deployment target lower without breaking other parts of ares's CI.~~ resolved, per below; SDL supporting 10.11 is built + bundled. ### Testing This has been tested to build properly locally and via GitHub CI. The .dylib is packaged inside the bundle correctly and SDL functions correctly in my testing, even if the user does not have SDL installed elsewhere on their system. This is seeking tests from other Mac users, especially on older operating systems, to verify that SDL works correctly there. Co-authored-by: jcm <[email protected]>
- Loading branch information
Showing
6 changed files
with
43 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
15ead9a40d09a1eb9972215cceac2bf29c9b77f6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
if [ ! -d "SDL" ]; then | ||
git clone https://github.com/libsdl-org/SDL.git -b SDL2 | ||
else | ||
git -C SDL fetch | ||
fi | ||
git -C SDL reset --hard "$(cat HEAD)" | ||
mkdir -p SDL/build | ||
pushd SDL/build | ||
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | ||
cmake .. "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" \ | ||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 | ||
cmake --build . | ||
sudo cmake --install . | ||
sudo xcode-select -s /Applications/Xcode_14.2.app/Contents/Developer | ||
popd | ||
cp SDL/build/libSDL2-2.0.0.dylib . |