Skip to content

Commit

Permalink
Corner case SDL / main
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Nov 29, 2023
1 parent aa7d1e0 commit 850ed53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/hello_imgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ if(APPLE AND NOT IOS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x objective-c++")
endif()

if(IOS)
target_compile_definitions(${target_name} PUBLIC HELLOIMGUI_IOS)
endif()

if (IOS)
target_compile_definitions(${target_name} PUBLIC IOS)
target_compile_definitions(${target_name} PUBLIC HELLOIMGUI_MOBILEDEVICE)
Expand Down
6 changes: 4 additions & 2 deletions src/hello_imgui/hello_imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
#include <cstdint>

#ifdef HELLOIMGUI_USE_SDL_OPENGL3
// Let SDL redefine main under iOS and co., but not under Windows, where we redefine WinMain
#ifdef _WIN32
#ifndef HELLOIMGUI_WIN32_AUTO_WINMAIN
// Under Windows, we redefine WinMain ourselves
#include <SDL.h>
#endif
#else
#endif
// Let SDL redefine main under iOS
#ifdef HELLOIMGUI_IOS
#include <SDL.h>
#endif
#endif
Expand Down

0 comments on commit 850ed53

Please sign in to comment.