Merge pull request #380 from Honeybunch/master

Slight tweak to get client library working with mingw
This commit is contained in:
Bartosz Taudul 2022-05-14 12:48:09 +02:00 committed by GitHub
commit 6233cf3fdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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})
@ -122,6 +127,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 && !defined(__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 ) );