Merge branch 'v14-cmake-improvements' into 'v14prep'

(v1.4) cmake improvements

See merge request KartKrew/Kart!634
This commit is contained in:
toaster 2022-08-04 14:34:39 +00:00
commit d939be8530
3 changed files with 34 additions and 31 deletions

View file

@ -138,7 +138,7 @@ HMS_connect (const char *format, ...)
return NULL; 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); quack_token = curl_easy_escape(curl, cv_masterserver_token.string, 0);
token_length = ( sizeof "&token="-1 )+ strlen(quack_token); token_length = ( sizeof "&token="-1 )+ strlen(quack_token);

View file

@ -147,24 +147,29 @@ if(${SDL2_FOUND})
set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME}) set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME})
if(${CMAKE_SYSTEM} MATCHES Darwin) if(${CMAKE_SYSTEM} MATCHES Darwin)
find_library(CORE_LIB CoreFoundation) find_library(CORE_FOUNDATION_LIBRARY "CoreFoundation")
target_link_libraries(SRB2SDL2 PRIVATE target_link_libraries(SRB2SDL2 PRIVATE
${CORE_LIB} ${CORE_FOUNDATION_LIBRARY}
SDL2
SDL2_mixer
${GME_LIBRARIES}
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
${OPENGL_LIBRARIES}
${CURL_LIBRARIES}
${DISCORDRPC_LIBRARIES}
) )
set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
else()
# 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 target_link_libraries(SRB2SDL2 PRIVATE
${SDL2_LIBRARIES} ${SDL2_LIBRARIES}
${SDL2_MIXER_LIBRARIES} ${SDL2_MIXER_LIBRARIES}
${GME_LIBRARIES} ${GME_LIBRARIES}
${OPENMPT_LIBRARIES}
${MIXERX_LIBRARIES}
${PNG_LIBRARIES} ${PNG_LIBRARIES}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
@ -178,7 +183,6 @@ if(${SDL2_FOUND})
rt rt
) )
endif() endif()
endif()
#target_link_libraries(SRB2SDL2 PRIVATE SRB2Core) #target_link_libraries(SRB2SDL2 PRIVATE SRB2Core)
@ -206,8 +210,6 @@ if(${SDL2_FOUND})
endif() endif()
endif() endif()
set_target_properties(SRB2SDL2 PROPERTIES VERSION ${SRB2_VERSION})
if(${CMAKE_SYSTEM} MATCHES Windows) if(${CMAKE_SYSTEM} MATCHES Windows)
target_link_libraries(SRB2SDL2 PRIVATE target_link_libraries(SRB2SDL2 PRIVATE
ws2_32 ws2_32
@ -278,6 +280,7 @@ if(${SDL2_FOUND})
install(TARGETS SRB2SDL2 install(TARGETS SRB2SDL2
BUNDLE DESTINATION . BUNDLE DESTINATION .
) )
set_property(TARGET SRB2SDL2 PROPERTY INSTALL_RPATH_USE_LINK_PATH ON)
else() else()
install(TARGETS SRB2SDL2 SRB2SDL2 install(TARGETS SRB2SDL2 SRB2SDL2
RUNTIME DESTINATION . RUNTIME DESTINATION .

View file

@ -102,7 +102,7 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#endif #endif
#endif #endif
#if (defined (__unix__) && !defined (_MSDOS)) || defined (UNIXCOMMON) #if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__))
#include <errno.h> #include <errno.h>
#include <sys/wait.h> #include <sys/wait.h>
#define NEWSIGNALHANDLER #define NEWSIGNALHANDLER