Skip to content

Commit

Permalink
Add GitHub Actions workflow for iOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
vrstanchev committed Nov 4, 2024
1 parent c63471f commit d6ae988
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,33 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Install SDL2
- name: Install dependencies
run: |
brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf
# Ensure Homebrew is up-to-date
brew update
# Install required tools and libraries
brew install cmake # Assuming you might need CMake for SDL2 build
- name: Clone SDL2 for iOS
run: |
git clone https://github.com/libsdl-org/SDL.git
cd SDL
git checkout main # or the desired branch/tag
cd Xcode-iOS
./build-sdl.sh # This script should compile SDL2 for iOS
- name: Verify SDL2 Installation Path
run: |
echo "SDL2 path:" $(brew --prefix sdl2)
ls /opt/homebrew/opt/sdl2/include/SDL2
echo "SDL2 path:" $(pwd)/SDL/Xcode-iOS/build/ios/Debug-iphoneos/
ls SDL/Xcode-iOS/build/ios/Debug-iphoneos/include/SDL2
- name: Compile the iOS App
run: |
mkdir -p build
SDK_PATH=$(xcrun --sdk iphoneos --show-sdk-path)
clang -v -o build/MyIOSApp main.c \
-I/opt/homebrew/opt/sdl2/include \
-L/opt/homebrew/opt/sdl2/lib \
-I$(pwd)/SDL/Xcode-iOS/build/ios/Debug-iphoneos/include \
-L$(pwd)/SDL/Xcode-iOS/build/ios/Debug-iphoneos/lib \
-lSDL2 \
-framework UIKit \
-framework Foundation \
Expand Down

0 comments on commit d6ae988

Please sign in to comment.