iOS (SDL_RENDERER backend)


You must have already build SDL2 and SDL2_ttf for iOS and verified that you can run your SDL2 app on your device or emulator. Only then should you proceed with installing TGUI.

You will need to use CMake in order to build TGUI. You can download the latest version here. After installing the GUI app, you will need to run the following from a terminal to make cmake usable from the terminal:

sudo "/Applications/" --install

The TGUI source code can be downloaded from the download page.


For information about cross-compiling options for iOS with CMake that aren’t specific to TGUI, see CMake’s toolchains manual.

Execute something similar to the following in a terminal from within the TGUI folder:

cmake -S . -B build-ios \
  -GXcode \
  -DCMAKE_INSTALL_PREFIX=`pwd`/install-ios \
  -DSDL2_LIBRARY=/Path/to/libSDL2.a \
  -DSDL2_INCLUDE_DIR=/Path/to/SDL/include/ \
  -DSDL2_TTF_LIBRARY=/Path/to/libSDL2_ttf.a \

Here is an explanation of each option:

Building the library

The previous step will have created an Xcode project for building TGUI (if -GXcode was used). You can build it from the terminal with the following command:

cmake --build build-ios --config Release --target install

If all goes well, the newly created install-ios folder will contain a lib folder with the static tgui library in it (inside a Debug or Release subfolder if you used Xcode).

Using TGUI

Note that using TGUI in an iOS app has never actually been tested.

You should be able to just drag the tgui-s.a (or tgui-s-d.a) file into your project.