cmake: only add -Wl,--undefined=WinMain when building an executable

This commit is contained in:
Anonymous Maarten authored and Ozkan Sezer committed 2022-09-19 05:00:24 +03:00
1 parent c833294817
commit 3b20e0ecef
3 files changed
+59 -2

No files matched your search

+2 -2
View File
@@ -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)