1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

* Fixed BreakPad on win32, I hope.

This commit is contained in:
Christian Muehlhaeuser
2011-09-28 00:21:17 +02:00
parent d901f0ba86
commit 42d8476ea1
5 changed files with 16 additions and 15 deletions

View File

@@ -239,6 +239,7 @@ IF(QCA2_FOUND)
ENDIF(QCA2_FOUND) ENDIF(QCA2_FOUND)
TARGET_LINK_LIBRARIES( tomahawk TARGET_LINK_LIBRARIES( tomahawk
tomahawk_breakpad
${LINK_LIBRARIES} ${LINK_LIBRARIES}
${TOMAHAWK_LIBRARIES} ${TOMAHAWK_LIBRARIES}
${PHONON_LIBS} ${PHONON_LIBS}

View File

@@ -6,11 +6,6 @@ ADD_DEFINITIONS( -fPIC )
SET( QXTWEB_LIBRARIES qxtweb-standalone ) SET( QXTWEB_LIBRARIES qxtweb-standalone )
SET( OS_SPECIFIC_LINK_LIBRARIES
${OS_SPECIFIC_LINK_LIBRARIES}
tomahawk_breakpad
)
IF( APPLE ) IF( APPLE )
INCLUDE( "CMakeLists.osx.txt" ) INCLUDE( "CMakeLists.osx.txt" )
ENDIF( APPLE ) ENDIF( APPLE )

View File

@@ -3,6 +3,7 @@ SET( CMAKE_BUILD_TYPE "Release" )
ADD_DEFINITIONS( /DNOMINMAX ) ADD_DEFINITIONS( /DNOMINMAX )
ADD_DEFINITIONS( /DWIN32_LEAN_AND_MEAN ) ADD_DEFINITIONS( /DWIN32_LEAN_AND_MEAN )
ADD_DEFINITIONS( -static-libgcc ) ADD_DEFINITIONS( -static-libgcc )
ADD_DEFINITIONS( -DUNICODE )
SET( QXTWEB_LIBRARIES qxtweb-standalone ) SET( QXTWEB_LIBRARIES qxtweb-standalone )

View File

@@ -22,11 +22,11 @@
#include <QString> #include <QString>
#include <string.h> #include <string.h>
#define CRASH_REPORTER_BINARY "CrashReporter"
#ifndef WIN32 #ifndef WIN32
#include <unistd.h> #include <unistd.h>
#define CRASH_REPORTER_BINARY "CrashReporter"
static bool static bool
LaunchUploader( const char* dump_dir, const char* minidump_id, void* that, bool succeeded ) LaunchUploader( const char* dump_dir, const char* minidump_id, void* that, bool succeeded )
@@ -96,8 +96,8 @@ LaunchUploader( const wchar_t* dump_dir, const wchar_t* minidump_id, void* that,
const char* productName = static_cast<BreakPad*>(that)->productName(); const char* productName = static_cast<BreakPad*>(that)->productName();
// convert productName to widechars, which sadly means the product name must be Latin1 // convert productName to widechars, which sadly means the product name must be Latin1
wchar_t wcProductName[ 256 ]; wchar_t product_name[ 256 ];
char* out = (char*)wcProductName; char* out = (char*)product_name;
const char* in = productName - 1; const char* in = productName - 1;
do { do {
*out++ = *++in; //latin1 chars fit in first byte of each wchar *out++ = *++in; //latin1 chars fit in first byte of each wchar
@@ -111,19 +111,19 @@ LaunchUploader( const wchar_t* dump_dir, const wchar_t* minidump_id, void* that,
wcscat( command, L"\" \"" ); wcscat( command, L"\" \"" );
wcscat( command, minidump_id ); wcscat( command, minidump_id );
wcscat( command, L"\" \"" ); wcscat( command, L"\" \"" );
wcscat( command, wcProductName ); wcscat( command, product_name );
wcscat( command, L"\"" ); wcscat( command, L"\"" );
STARTUPINFO si; STARTUPINFO si;
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof( si ) ); ZeroMemory( &si, sizeof( si ) );
si.cb = sizeof( si ); si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW; si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOWNORMAL; si.wShowWindow = SW_SHOWNORMAL;
ZeroMemory( &pi, sizeof( pi ) ); ZeroMemory( &pi, sizeof(pi) );
if ( CreateProcess( NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) ) if (CreateProcess( NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
{ {
CloseHandle( pi.hProcess ); CloseHandle( pi.hProcess );
CloseHandle( pi.hThread ); CloseHandle( pi.hThread );

View File

@@ -66,7 +66,7 @@ IF(UNIX)
ENDIF(UNIX) ENDIF(UNIX)
IF(WIN32) IF(WIN32)
ADD_DEFINITIONS( -DUNICODE ) ADD_DEFINITIONS( -DUNICODE -fshort-wchar )
SET( breakpadSources SET( breakpadSources
client/windows/handler/exception_handler.cc client/windows/handler/exception_handler.cc
client/windows/crash_generation/crash_generation_client.cc client/windows/crash_generation/crash_generation_client.cc
@@ -77,5 +77,9 @@ ENDIF(WIN32)
INCLUDE_DIRECTORIES(.) INCLUDE_DIRECTORIES(.)
ADD_DEFINITIONS( -fPIC ) ADD_DEFINITIONS( -fPIC )
ADD_LIBRARY( tomahawk_breakpad STATIC ${breakpadSources} ) IF(WIN32)
ADD_LIBRARY( tomahawk_breakpad SHARED ${breakpadSources} )
ELSE()
ADD_LIBRARY( tomahawk_breakpad STATIC ${breakpadSources} )
ENDIF()
TARGET_LINK_LIBRARIES( tomahawk_breakpad ) TARGET_LINK_LIBRARIES( tomahawk_breakpad )