Fix sentry compile issues on macOS

This commit is contained in:
Jon Evans 2023-09-19 20:30:57 -04:00
parent 9deff07ca6
commit 9973dd3e5d
4 changed files with 9 additions and 3 deletions

View File

@ -997,7 +997,9 @@ if( KICAD_USE_SENTRY )
message( FATAL_ERROR "Sentry DSN must be configured with KICAD_USE_SENTRY" )
endif()
set( CRASHPAD_WER_ENABLED ON )
if( WIN32 )
set( CRASHPAD_WER_ENABLED ON )
endif()
add_subdirectory( thirdparty/sentry-native )
add_compile_definitions( KICAD_USE_SENTRY )
endif()

View File

@ -338,7 +338,11 @@ void PGM_BASE::sentryInit()
tmp.AssignDir( PATHS::GetUserCachePath() );
tmp.AppendDir( "sentry" );
#ifdef __WINDOWS__
sentry_options_set_database_pathw( options, tmp.GetPathWithSep().wc_str() );
#else
sentry_options_set_database_path( options, tmp.GetPathWithSep().c_str() );
#endif
sentry_options_set_symbolize_stacktraces( options, true );
sentry_options_set_auto_session_tracking( options, false );

View File

@ -482,7 +482,7 @@ if(SENTRY_BACKEND_CRASHPAD)
endif()
endif()
add_dependencies(sentry crashpad::handler)
if(CRASHPAD_WER_ENABLED)
if(WIN32 AND CRASHPAD_WER_ENABLED)
add_dependencies(sentry crashpad::wer)
endif()
elseif(SENTRY_BACKEND_BREAKPAD)

View File

@ -123,7 +123,7 @@ if(NOT IOS)
)
endif()
if(CRASHPAD_WER_ENABLED)
if(WIN32 AND CRASHPAD_WER_ENABLED)
add_library(crashpad_wer SHARED
win/wer/crashpad_wer.cc
win/wer/crashpad_wer.h