Slight tweak to get client library working with mingw

This commit is contained in:
Honeybunch 2022-05-03 18:31:49 -07:00
parent 8bf21bfb81
commit 45bd17b7e8
2 changed files with 7 additions and 2 deletions

View File

@ -16,6 +16,11 @@ target_link_libraries(
${CMAKE_DL_LIBS}
)
# Public dependency on some libraries required when using Mingw
if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
target_link_libraries(TracyClient PUBLIC ws2_32 dbghelp)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
find_library(EXECINFO_LIBRARY NAMES execinfo REQUIRED)
target_link_libraries(TracyClient PUBLIC ${EXECINFO_LIBRARY})
@ -123,6 +128,6 @@ install(FILES ${client_includes}
install(FILES ${common_includes}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/common)
install(EXPORT TracyConfig
NAMESPACE Tracy::
NAMESPACE Tracy::
FILE TracyConfig.cmake
DESTINATION share/Tracy)

View File

@ -265,7 +265,7 @@ void WINAPI EventRecordCallbackVsync( PEVENT_RECORD record )
static void SetupVsync()
{
#if _WIN32_WINNT >= _WIN32_WINNT_WINBLUE
#if _WIN32_WINNT >= _WIN32_WINNT_WINBLUE && !__MINGW32__
const auto psz = sizeof( EVENT_TRACE_PROPERTIES ) + MAX_PATH;
s_propVsync = (EVENT_TRACE_PROPERTIES*)tracy_malloc( psz );
memset( s_propVsync, 0, sizeof( EVENT_TRACE_PROPERTIES ) );