From de1c19b3f51cd3d5681c7d3d319672a51c0c31f5 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 25 Jan 2021 20:43:21 -0800 Subject: [PATCH] Fixed bug 5481 - iOS-specific main sources not used for CMake build. Aaron Barany The CMake build for SDL doesn't set SDLMAIN_SOURCES on iOS to the sources in src/main/ios. As a result, SDL fails to initialize since it falls back to the dummy main. Adding the line file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/uikit/*.c) fixes the issue. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39adf3168..381ac9926 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1691,6 +1691,7 @@ elseif(APPLE) if(IOS OR TVOS) file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/ios/*.m) + file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/uikit/*.c) else() file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m) endif()