diff --git a/src/http-mserv.c b/src/http-mserv.c index e925c50d..919acf33 100644 --- a/src/http-mserv.c +++ b/src/http-mserv.c @@ -138,7 +138,7 @@ HMS_connect (const char *format, ...) return NULL; } - if (cv_masterserver_token.string[0]) + if (cv_masterserver_token.string && cv_masterserver_token.string[0]) { quack_token = curl_easy_escape(curl, cv_masterserver_token.string, 0); token_length = ( sizeof "&token="-1 )+ strlen(quack_token); diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 04670bdc..b285eed5 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -147,37 +147,41 @@ if(${SDL2_FOUND}) set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME}) if(${CMAKE_SYSTEM} MATCHES Darwin) - find_library(CORE_LIB CoreFoundation) + find_library(CORE_FOUNDATION_LIBRARY "CoreFoundation") target_link_libraries(SRB2SDL2 PRIVATE - ${CORE_LIB} - SDL2 - SDL2_mixer - ${GME_LIBRARIES} - ${PNG_LIBRARIES} - ${ZLIB_LIBRARIES} - ${OPENGL_LIBRARIES} - ${CURL_LIBRARIES} - ${DISCORDRPC_LIBRARIES} + ${CORE_FOUNDATION_LIBRARY} ) set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") - else() - target_link_libraries(SRB2SDL2 PRIVATE - ${SDL2_LIBRARIES} - ${SDL2_MIXER_LIBRARIES} - ${GME_LIBRARIES} - ${PNG_LIBRARIES} - ${ZLIB_LIBRARIES} - ${OPENGL_LIBRARIES} - ${CURL_LIBRARIES} - ${DISCORDRPC_LIBRARIES} - ) - if(${CMAKE_SYSTEM} MATCHES Linux) - target_link_libraries(SRB2SDL2 PRIVATE - m - rt - ) - endif() + # Configure the app bundle icon and plist properties + target_sources(SRB2SDL2 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/macosx/Srb2mac.icns") + set_target_properties(SRB2SDL2 PROPERTIES + MACOSX_BUNDLE_ICON_FILE "Srb2mac" + MACOSX_BUNDLE_BUNDLE_NAME "Sonic Robo Blast 2" + MACOSX_BUNDLE_BUNDLE_VERSION ${SRB2_VERSION} + + RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/macosx/Srb2mac.icns" + ) + endif() + + target_link_libraries(SRB2SDL2 PRIVATE + ${SDL2_LIBRARIES} + ${SDL2_MIXER_LIBRARIES} + ${GME_LIBRARIES} + ${OPENMPT_LIBRARIES} + ${MIXERX_LIBRARIES} + ${PNG_LIBRARIES} + ${ZLIB_LIBRARIES} + ${OPENGL_LIBRARIES} + ${CURL_LIBRARIES} + ${DISCORDRPC_LIBRARIES} + ) + + if(${CMAKE_SYSTEM} MATCHES Linux) + target_link_libraries(SRB2SDL2 PRIVATE + m + rt + ) endif() #target_link_libraries(SRB2SDL2 PRIVATE SRB2Core) @@ -206,8 +210,6 @@ if(${SDL2_FOUND}) endif() endif() - set_target_properties(SRB2SDL2 PROPERTIES VERSION ${SRB2_VERSION}) - if(${CMAKE_SYSTEM} MATCHES Windows) target_link_libraries(SRB2SDL2 PRIVATE ws2_32 @@ -278,6 +280,7 @@ if(${SDL2_FOUND}) install(TARGETS SRB2SDL2 BUNDLE DESTINATION . ) + set_property(TARGET SRB2SDL2 PROPERTY INSTALL_RPATH_USE_LINK_PATH ON) else() install(TARGETS SRB2SDL2 SRB2SDL2 RUNTIME DESTINATION . diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 7ec85e5d..8cb479b8 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -102,7 +102,7 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T); #endif #endif -#if (defined (__unix__) && !defined (_MSDOS)) || defined (UNIXCOMMON) +#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__)) #include #include #define NEWSIGNALHANDLER