Add SDL2main support for Windows builds in CMake configuration

- Updated the CMake configuration to include SDL2main for Windows builds when using the bundled SDL.
- Added a definition to handle SDL main entry point, improving compatibility for Windows applications.
- Updated changelog to reflect the new support for SDL2main in version 0.3.1.
This commit is contained in:
scawful
2025-09-28 10:49:46 -04:00
parent 3a940a0cc2
commit 20a93bc491
2 changed files with 7 additions and 1 deletions

View File

@@ -10,6 +10,12 @@ if (UNIX OR MINGW OR WIN32)
)
# Also set for consistency with bundled SDL
set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
# Add SDL2main for Windows builds when using bundled SDL
if(WIN32)
list(PREPEND SDL_TARGETS SDL2main ws2_32)
add_definitions("-DSDL_MAIN_HANDLED")
endif()
else()
find_package(SDL2)
# When using system SDL, use the imported targets