imgui-frontend-engineer: add iOS platform scaffolding

This commit is contained in:
scawful
2025-12-28 10:57:53 -06:00
parent 954c612f69
commit c9df4372d7
48 changed files with 2328 additions and 304 deletions

View File

@@ -10,6 +10,29 @@ include(cmake/dependencies.lock)
message(STATUS "Setting up cpp-httplib ${HTTPLIB_VERSION}")
if(YAZE_PLATFORM_IOS)
CPMAddPackage(
NAME httplib
VERSION ${HTTPLIB_VERSION}
GITHUB_REPOSITORY yhirose/cpp-httplib
GIT_TAG v${HTTPLIB_VERSION}
DOWNLOAD_ONLY YES
)
if(NOT TARGET httplib)
add_library(httplib INTERFACE)
target_include_directories(httplib INTERFACE ${httplib_SOURCE_DIR})
endif()
if(NOT TARGET httplib::httplib)
add_library(httplib::httplib ALIAS httplib)
endif()
set(YAZE_HTTPLIB_TARGETS httplib::httplib)
set(YAZE_HTTPLIB_TARGETS httplib::httplib CACHE INTERNAL "cpp-httplib targets")
message(STATUS "cpp-httplib configured as header-only for iOS")
return()
endif()
set(_YAZE_USE_SYSTEM_HTTPLIB ${YAZE_USE_SYSTEM_DEPS})
# Try to use system packages first

View File

@@ -21,6 +21,12 @@ else()
message(STATUS "Using ImGui SDL2 backend")
endif()
if(YAZE_PLATFORM_IOS)
list(APPEND IMGUI_BACKEND_SOURCES
${IMGUI_DIR}/backends/imgui_impl_metal.mm
)
endif()
# Create ImGui library with core files from bundled source
add_library(ImGui STATIC
${IMGUI_DIR}/imgui.cpp

View File

@@ -74,7 +74,7 @@ if(NOT TARGET yaze_sdl2)
target_link_libraries(yaze_sdl2 INTERFACE SDL2::SDL2-static)
# For local Homebrew SDL2, also add include path explicitly
# SDL headers are in the SDL2 subdirectory
if(APPLE AND EXISTS "/opt/homebrew/opt/sdl2/include/SDL2")
if(YAZE_PLATFORM_MACOS AND EXISTS "/opt/homebrew/opt/sdl2/include/SDL2")
target_include_directories(yaze_sdl2 INTERFACE /opt/homebrew/opt/sdl2/include/SDL2)
message(STATUS "Added Homebrew SDL2 include path: /opt/homebrew/opt/sdl2/include/SDL2")
endif()
@@ -94,7 +94,7 @@ if(WIN32)
wbemuuid
)
target_compile_definitions(yaze_sdl2 INTERFACE SDL_MAIN_HANDLED)
elseif(APPLE)
elseif(YAZE_PLATFORM_MACOS)
target_link_libraries(yaze_sdl2 INTERFACE
"-framework Cocoa"
"-framework IOKit"
@@ -102,6 +102,20 @@ elseif(APPLE)
"-framework ForceFeedback"
)
target_compile_definitions(yaze_sdl2 INTERFACE SDL_MAIN_HANDLED)
elseif(YAZE_PLATFORM_IOS)
target_link_libraries(yaze_sdl2 INTERFACE
"-framework UIKit"
"-framework Foundation"
"-framework CoreGraphics"
"-framework CoreVideo"
"-framework CoreMotion"
"-framework QuartzCore"
"-framework AVFoundation"
"-framework AudioToolbox"
"-framework Metal"
"-framework GameController"
)
target_compile_definitions(yaze_sdl2 INTERFACE SDL_MAIN_HANDLED)
elseif(UNIX)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)

View File

@@ -63,7 +63,7 @@ if(NOT TARGET yaze_sdl3)
message(STATUS "Using SDL3::SDL3-static target")
target_link_libraries(yaze_sdl3 INTERFACE SDL3::SDL3-static)
# For local Homebrew SDL3, also add include path explicitly
if(APPLE AND EXISTS "/opt/homebrew/opt/sdl3/include/SDL3")
if(YAZE_PLATFORM_MACOS AND EXISTS "/opt/homebrew/opt/sdl3/include/SDL3")
target_include_directories(yaze_sdl3 INTERFACE /opt/homebrew/opt/sdl3/include/SDL3)
message(STATUS "Added Homebrew SDL3 include path: /opt/homebrew/opt/sdl3/include/SDL3")
endif()
@@ -83,7 +83,7 @@ if(WIN32)
wbemuuid
)
target_compile_definitions(yaze_sdl3 INTERFACE SDL_MAIN_HANDLED)
elseif(APPLE)
elseif(YAZE_PLATFORM_MACOS)
target_link_libraries(yaze_sdl3 INTERFACE
"-framework Cocoa"
"-framework IOKit"
@@ -93,6 +93,20 @@ elseif(APPLE)
"-framework GameController"
)
target_compile_definitions(yaze_sdl3 INTERFACE SDL_MAIN_HANDLED)
elseif(YAZE_PLATFORM_IOS)
target_link_libraries(yaze_sdl3 INTERFACE
"-framework UIKit"
"-framework Foundation"
"-framework CoreGraphics"
"-framework CoreVideo"
"-framework CoreMotion"
"-framework QuartzCore"
"-framework AVFoundation"
"-framework AudioToolbox"
"-framework Metal"
"-framework GameController"
)
target_compile_definitions(yaze_sdl3 INTERFACE SDL_MAIN_HANDLED)
elseif(UNIX)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
@@ -107,4 +121,4 @@ set(YAZE_SDL3_TARGETS yaze_sdl3)
# Set a flag to indicate SDL3 is being used
set(YAZE_SDL2_TARGETS ${YAZE_SDL3_TARGETS}) # For compatibility with existing code
message(STATUS "SDL3 setup complete - YAZE_SDL3_TARGETS = ${YAZE_SDL3_TARGETS}")
message(STATUS "SDL3 setup complete - YAZE_SDL3_TARGETS = ${YAZE_SDL3_TARGETS}")