diff --git a/cmake/Dependencies/CMakeLists.txt b/cmake/Dependencies/CMakeLists.txt index 41c8847caf..ba11f47ec0 100644 --- a/cmake/Dependencies/CMakeLists.txt +++ b/cmake/Dependencies/CMakeLists.txt @@ -679,7 +679,9 @@ if(MENGINE_DEPENDENCE_SDL) ADD_SUBDIRECTORY(${THIRDPARTY_DIR}/SDL ${THIRDPARTY_CONFIG_DIR}/SDL) - target_compile_definitions(SDL2-static PUBLIC -DSDL_MAIN_HANDLED) + if(MENGINE_TARGET_IOS OR MENGINE_TARGET_IOS_SIMULATOR) + target_compile_definitions(SDL2-static PUBLIC -DSDL_MAIN_HANDLED) + endif() set(SDL2_DIR "${THIRDPARTY_CONFIG_DIR}/SDL" CACHE STRING "SDL2_DIR" FORCE)