Skip to content

Commit

Permalink
Add CI / iOS and Android
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Jan 14, 2024
1 parent c6ce6a0 commit a92c205
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Android

# Builds _example_integration for Android

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Checkout submodules
run: git submodule update --init --recursive

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'

# - name: Setup interactive tmate session
# uses: mxschmitt/action-tmate@v3

- name: invoke cmake to create gradle / android studio project
# This will create the project
# build_android/hello_imgui_demodocking_AndroidStudio
run: |
cd _example_integration
mkdir -p external
cd external
ln -s ../../ imgui_bundle
cd ..
mkdir build_android
cd build_android
export ANDROID_HOME=/usr/local/lib/android/sdk
../external/imgui_bundle/external/hello_imgui/hello_imgui/tools/android/cmake_arm-android.sh ..
- name: gradlew build
# This will build for all android architectures
run: |
export ANDROID_HOME=/usr/local/lib/android/sdk
cd _example_integration/build_android/imgui_bundle_example_integration_AndroidStudio
./gradlew build
44 changes: 44 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "ios"

# Builds _example_integration for iOS simulator

on:
workflow_dispatch:
pull_request:
push:

jobs:
build:
name: "ios"
runs-on: macos-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive

# - name: Setup interactive tmate session
# uses: mxschmitt/action-tmate@v3


- name: CMake
run: |
cd _example_integration
mkdir -p external
cd external
ln -s ../.. imgui_bundle
cd ..
mkdir build-ios
cd build-ios
cmake .. \
-GXcode \
-DCMAKE_TOOLCHAIN_FILE=../external/imgui_bundle/external/hello_imgui/hello_imgui/hello_imgui_cmake/ios-cmake/ios.toolchain.cmake \
-DHELLOIMGUI_USE_SDL_OPENGL3=ON \
-DPLATFORM=SIMULATOR64
- name: Build for simulator
working-directory: _example_integration/build-ios
run: |
xcodebuild -configuration Release -project imgui_bundle_example_integration.xcodeproj -target ALL_BUILD -arch x86_64 -sdk iphonesimulator
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ project(imgui_bundle VERSION "1.2.1") # Remember to mirror changes to setup.py!
# * It will perform additional customization (app icon and name on mobile platforms, etc)



###############################################################################
# Build Options
###############################################################################
Expand Down Expand Up @@ -208,6 +209,13 @@ option(IMGUI_BUNDLE_BUILD_CI_AUTOMATION_TESTS "Build CI automation tests" OFF)
# Main
###############################################################################

# Avoid building imgui_bundle twice
if(TARGET imgui_bundle)
message(STATUS "imgui_bundle target already defined!")
return()
endif()


# Everything is built as a static library in imgui_bundle
set(BUILD_SHARED_LIBS OFF)

Expand Down

0 comments on commit a92c205

Please sign in to comment.