The iOS example now runs

0.8
Bruno Van de Velde 2018-04-12 22:32:52 +02:00
parent 48acc7f821
commit b27e051e7b
3 changed files with 5 additions and 2 deletions

View File

@ -172,7 +172,7 @@ if(TGUI_OS_WINDOWS AND TGUI_COMPILER_MSVC) # Also look for the main component wh
elseif(TGUI_OS_ANDROID) # Search for SFML in the android NDK (if no other directory is specified)
find_package(SFML 2 COMPONENTS graphics window system PATHS "${CMAKE_ANDROID_NDK}/sources/third_party/sfml/lib/cmake/SFML")
elseif(TGUI_OS_IOS) # Use the find_host_package macro from the toolchain on iOS
find_host_package(SFML 2 COMPONENTS graphics window system)
find_host_package(SFML 2 COMPONENTS main graphics window system)
else()
find_package(SFML 2 COMPONENTS graphics window system)
endif()

View File

@ -17,7 +17,7 @@ macro(tgui_add_example target)
target_link_libraries(${target} PRIVATE tgui)
# Link to sfml-main (only when SFMLConfig.cmake is used, this is done through the tgui target if FindSFML.cmake is used)
if(TGUI_OS_WINDOWS AND NOT DEFINED SFML_LIBRARIES)
if((TGUI_OS_WINDOWS OR TGUI_OS_IOS) AND NOT DEFINED SFML_LIBRARIES)
target_link_libraries(${target} PRIVATE sfml-main)
endif()

View File

@ -74,6 +74,9 @@
#include <TGUI/SignalImpl.hpp>
#include <SFML/Graphics.hpp>
#ifdef SFML_SYSTEM_IOS
#include <SFML/Main.hpp>
#endif
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////