Fix linking on Msys2.
Do not link `SDL2main` on any WIN32, not just MSVC. Define `WIN32_CONSOLE_APP` for Debug mode builds on any WIN32, not just MSVC. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
e2634df5cc
commit
22a3524c66
|
@ -158,7 +158,7 @@ ENDIF(MINGW)
|
|||
|
||||
IF(SDL2_LIBRARY_TEMP)
|
||||
# For SDL2main
|
||||
if(SDL2MAIN_LIBRARY AND NOT MSVC)
|
||||
if(SDL2MAIN_LIBRARY AND NOT WIN32)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
|
||||
endif()
|
||||
|
||||
|
|
|
@ -992,15 +992,15 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||
endif()
|
||||
elseif(MSVC)
|
||||
# the debug lib libcmtd is linked in debug mode, so don't link the normal version
|
||||
# also make the app a console app in debug mode
|
||||
set_target_properties(visualboyadvance-m PROPERTIES LINK_FLAGS_DEBUG "/nodefaultlib:libcmt /subsystem:console")
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
# to get the debug console mode app to work correctly
|
||||
target_compile_definitions(visualboyadvance-m PRIVATE -DWIN32_CONSOLE_APP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Make the app a console app in debug mode to get log messages.
|
||||
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
target_compile_definitions(visualboyadvance-m PRIVATE -DWIN32_CONSOLE_APP)
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/visualboyadvance-m.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/visualboyadvance-m.appdata.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/appdata)
|
||||
|
|
Loading…
Reference in New Issue