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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user