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 b312cf9 commit 07b1903
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,21 @@ jobs:
run: |
brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf
- name: Find SDL2 path
- name: Verify SDL2 Installation Path
run: |
echo "SDL2 installed at:" $(brew --prefix sdl2)
ls $(brew --prefix sdl2)/include/SDL2
echo "SDL2 path:" $(brew --prefix sdl2)
ls /opt/homebrew/opt/sdl2/include/SDL2
- name: Compile the iOS App
run: |
mkdir -p build
SDL2_PATH=$(brew --prefix sdl2)
clang -o build/MyIOSApp main.c -I$SDL2_PATH/include/SDL2 -L$SDL2_PATH/lib -lSDL2 -framework UIKit -framework Foundation -framework CoreGraphics
clang -v -o build/MyIOSApp main.c \
-I/opt/homebrew/opt/sdl2/include \
-L/opt/homebrew/opt/sdl2/lib \
-lSDL2 \
-framework UIKit \
-framework Foundation \
-framework CoreGraphics
- name: Upload the build artifact
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <sdl2/SDL.h>
#include <SDL2/SDL.h>
#include <stdio.h>

int main(int argc, char *argv[]) {
Expand Down

0 comments on commit 07b1903

Please sign in to comment.