diff --git a/3rdparty/google-breakpad/CMakeLists.txt b/3rdparty/google-breakpad/CMakeLists.txt index fe547fcf3..924d7cfb8 100644 --- a/3rdparty/google-breakpad/CMakeLists.txt +++ b/3rdparty/google-breakpad/CMakeLists.txt @@ -91,6 +91,8 @@ endif() add_library(libbreakpad_common STATIC ${COMMON_SOURCES}) add_library(breakpad STATIC ${LIBRARY_SOURCES}) + +# This is used by cmake/DumpSymbols.cmake add_executable(dump_syms ${DUMP_SYMS_SOURCES}) target_link_libraries(breakpad libbreakpad_common) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0b2cf75b..4f59654a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -454,6 +454,10 @@ if(HAVE_MOODBAR) add_subdirectory(gst/moodbar) endif() +# Breakpad symbol target. Included after everything else since it uses some +# variables defined above. +include(cmake/DumpSymbols.cmake) + # Uninstall support configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" diff --git a/cmake/DumpSymbols.cmake b/cmake/DumpSymbols.cmake new file mode 100644 index 000000000..d58055d8b --- /dev/null +++ b/cmake/DumpSymbols.cmake @@ -0,0 +1,14 @@ +if (HAVE_BREAKPAD) + add_custom_target(breakpad_symbols + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMAND python + ../dist/dump_all_symbols.py + --symbols_directory breakpad_symbols + --dump_syms_binary "$" + --crashreporting_hostname "${CRASHREPORTING_HOSTNAME}" + "$" + COMMENT "Dumping and uploading breakpad symbols to ${CRASHREPORTING_HOSTNAME}" + ) + + add_dependencies(breakpad_symbols clementine dump_syms) +endif() diff --git a/dist/dump_all_symbols.py b/dist/dump_all_symbols.py index c17d9c0c5..726d7528d 100644 --- a/dist/dump_all_symbols.py +++ b/dist/dump_all_symbols.py @@ -28,7 +28,14 @@ class BaseDumperImpl(object): raise NotImplementedError def DebugSymbolsFilename(self, filename): - return filename + class Context(object): + def __enter__(self): + return filename + + def __exit__(self, exc_type, exc_value, traceback): + pass + + return Context() class LinuxDumperImpl(BaseDumperImpl):