cmake: only add -Wl,--undefined=WinMain when building an executable
This commit is contained in:
committed by
Ozkan Sezer
parent
c833294817
commit
3b20e0ecef
@@ -3049,9 +3049,9 @@ if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN)
|
||||
if(MINGW OR CYGWIN)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
target_link_options(SDL2main PUBLIC "-Wl,--undefined=_WinMain@16")
|
||||
target_link_options(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=_WinMain@16>")
|
||||
else()
|
||||
target_link_options(SDL2main PUBLIC "-Wl,--undefined=WinMain")
|
||||
target_link_options(SDL2main PUBLIC "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=WinMain>")
|
||||
endif()
|
||||
endif()
|
||||
if (NOT ANDROID)
|
||||
|
||||
Reference in New Issue
Block a user