diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e37c1fa33..782244ba3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -239,6 +239,7 @@ IF(QCA2_FOUND) ENDIF(QCA2_FOUND) TARGET_LINK_LIBRARIES( tomahawk + tomahawk_breakpad ${LINK_LIBRARIES} ${TOMAHAWK_LIBRARIES} ${PHONON_LIBS} diff --git a/src/CMakeLists.unix.txt b/src/CMakeLists.unix.txt index 7aba34e58..975ddf20f 100644 --- a/src/CMakeLists.unix.txt +++ b/src/CMakeLists.unix.txt @@ -6,11 +6,6 @@ ADD_DEFINITIONS( -fPIC ) SET( QXTWEB_LIBRARIES qxtweb-standalone ) -SET( OS_SPECIFIC_LINK_LIBRARIES - ${OS_SPECIFIC_LINK_LIBRARIES} - tomahawk_breakpad -) - IF( APPLE ) INCLUDE( "CMakeLists.osx.txt" ) ENDIF( APPLE ) diff --git a/src/CMakeLists.win32.txt b/src/CMakeLists.win32.txt index 19a1aae1a..6455ae8bc 100644 --- a/src/CMakeLists.win32.txt +++ b/src/CMakeLists.win32.txt @@ -3,6 +3,7 @@ SET( CMAKE_BUILD_TYPE "Release" ) ADD_DEFINITIONS( /DNOMINMAX ) ADD_DEFINITIONS( /DWIN32_LEAN_AND_MEAN ) ADD_DEFINITIONS( -static-libgcc ) +ADD_DEFINITIONS( -DUNICODE ) SET( QXTWEB_LIBRARIES qxtweb-standalone ) diff --git a/src/breakpad/BreakPad.cpp b/src/breakpad/BreakPad.cpp index 1d5d9360b..85caa87f5 100644 --- a/src/breakpad/BreakPad.cpp +++ b/src/breakpad/BreakPad.cpp @@ -22,11 +22,11 @@ #include #include +#define CRASH_REPORTER_BINARY "CrashReporter" + #ifndef WIN32 #include -#define CRASH_REPORTER_BINARY "CrashReporter" - static bool 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(that)->productName(); // convert productName to widechars, which sadly means the product name must be Latin1 - wchar_t wcProductName[ 256 ]; - char* out = (char*)wcProductName; + wchar_t product_name[ 256 ]; + char* out = (char*)product_name; const char* in = productName - 1; do { *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, minidump_id ); wcscat( command, L"\" \"" ); - wcscat( command, wcProductName ); + wcscat( command, product_name ); wcscat( command, L"\"" ); STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof( si ) ); - si.cb = sizeof( si ); + si.cb = sizeof(si); si.dwFlags = STARTF_USESHOWWINDOW; 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.hThread ); diff --git a/thirdparty/breakpad/CMakeLists.txt b/thirdparty/breakpad/CMakeLists.txt index da580319b..b590216b5 100644 --- a/thirdparty/breakpad/CMakeLists.txt +++ b/thirdparty/breakpad/CMakeLists.txt @@ -66,7 +66,7 @@ IF(UNIX) ENDIF(UNIX) IF(WIN32) - ADD_DEFINITIONS( -DUNICODE ) + ADD_DEFINITIONS( -DUNICODE -fshort-wchar ) SET( breakpadSources client/windows/handler/exception_handler.cc client/windows/crash_generation/crash_generation_client.cc @@ -77,5 +77,9 @@ ENDIF(WIN32) INCLUDE_DIRECTORIES(.) 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 )