Skip to content

Commit

Permalink
cmake: use target_link_libraries to pass -Wl,--undefined=WinMain
Browse files Browse the repository at this point in the history
(cherry-picked from commit e2060de)
  • Loading branch information
madebr authored and sezero committed Nov 29, 2022
1 parent d41985c commit b42c033
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3036,11 +3036,10 @@ if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN)
target_link_libraries(SDL2main PRIVATE shell32)
endif()
if(MINGW OR CYGWIN)
cmake_minimum_required(VERSION 3.13)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
target_link_options(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=_WinMain@16>")
target_link_libraries(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=_WinMain@16>")
else()
target_link_options(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=WinMain>")
target_link_libraries(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=WinMain>")
endif()
endif()
if (NOT ANDROID)
Expand Down

0 comments on commit b42c033

Please sign in to comment.