diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-10-11 14:43:44 +0300 |
---|---|---|
committer | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-10-15 15:32:50 +0300 |
commit | a5b33a6e437ec18672b8f54f35a6137ada33f97a (patch) | |
tree | a5f9f2776b9518dfc61e6d586a56067f8256a131 | |
parent | 41124396a01796d239c2d215f1d48a43221e3862 (diff) |
Use system breakepad on unixwork/system_breakpad
-rw-r--r-- | 3rdparty/CMakeLists.txt | 2 | ||||
-rw-r--r-- | 3rdparty/breakpad/CMakeLists.txt | 15 | ||||
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/libcrashreporter-gui/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/libcrashreporter-handler/CMakeLists.txt | 25 |
5 files changed, 26 insertions, 29 deletions
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 0407198..7812994 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -1,5 +1,3 @@ -add_subdirectory(breakpad) - if(ENABLE_GPL_CODE) add_subdirectory(drkonqi-parser) endif() diff --git a/3rdparty/breakpad/CMakeLists.txt b/3rdparty/breakpad/CMakeLists.txt index 137898a..12e1ac7 100644 --- a/3rdparty/breakpad/CMakeLists.txt +++ b/3rdparty/breakpad/CMakeLists.txt @@ -63,7 +63,6 @@ if(UNIX) endif() if(WIN32) - add_definitions( -DUNICODE -fshort-wchar ) list(APPEND breakpadSources client/windows/handler/exception_handler.cc client/windows/crash_generation/crash_generation_client.cc @@ -72,14 +71,20 @@ if(WIN32) endif() -include_directories(.) # ADD_DEFINITIONS( -fPIC ) add_library(crashreporter-breakpad STATIC ${breakpadSources} ) +target_include_directories( crashreporter-breakpad PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) + +if(WIN32) + target_compile_definitions(crashreporter-breakpad PRIVATE UNICODE _UNICODE) + if (NOT MSVC) + target_compile_options(crashreporter-breakpad PRIVATE -fshort-wchar ) + target_link_libraries(crashreporter-breakpad PUBLIC mingwex) + endif() +endif() if(NOT MSVC) target_link_libraries(crashreporter-breakpad pthread) endif() -if(WIN32 AND NOT MSVC) - target_link_libraries(crashreporter-breakpad "mingwex") -endif() +add_library(PkgConfig::BREAKPAD ALIAS crashreporter-breakpad) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e1e269..8054422 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ project(libcrashreporter-qt) -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.6) if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) @@ -16,6 +16,14 @@ endif() option(ENABLE_CRASH_REPORTER "Enable libcrashreporter-qt GUI component" ON) +if (NOT MSVC) + find_package(PkgConfig REQUIRED) + pkg_check_modules(BREAKPAD REQUIRED IMPORTED_TARGET breakpad breakpad-client) +else() + # with msvc we use an old fork + add_subdirectory(3rdparty/breakpad) +endif() + find_package(Qt5 COMPONENTS Core Network Widgets) add_definitions( -DQT_NO_FOREACH diff --git a/src/libcrashreporter-gui/CMakeLists.txt b/src/libcrashreporter-gui/CMakeLists.txt index feb32c0..0545640 100644 --- a/src/libcrashreporter-gui/CMakeLists.txt +++ b/src/libcrashreporter-gui/CMakeLists.txt @@ -30,10 +30,11 @@ add_library(crashreporter-gui STATIC target_include_directories(crashreporter-gui PUBLIC ${crashreporter_INCLUDE_DIRECTORIES}) -target_link_libraries(crashreporter-gui +target_link_libraries(crashreporter-gui PUBLIC Qt5::Core Qt5::Widgets Qt5::Network + PkgConfig::BREAKPAD ${crashreporter_LIBRARIES} ) diff --git a/src/libcrashreporter-handler/CMakeLists.txt b/src/libcrashreporter-handler/CMakeLists.txt index 135a2af..5d8b9c8 100644 --- a/src/libcrashreporter-handler/CMakeLists.txt +++ b/src/libcrashreporter-handler/CMakeLists.txt @@ -1,25 +1,10 @@ -# message(FATAL_ERROR "${CMAKE_CURRENT_LIST_DIR}/../../3rdparty/breakpad") +add_library(crashreporter-handler STATIC Handler.cpp) +target_include_directories(crashreporter-handler PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>) -list(APPEND crashreporter-handler_INCLUDE_DIRECTORIES - ${CMAKE_CURRENT_LIST_DIR}/.. - ${CMAKE_CURRENT_LIST_DIR}/../../3rdparty/breakpad - ${QT_QTCORE_INCLUDE_DIR} -) - -list(APPEND crashreporter-handler_SOURCES - Handler.cpp -) - -list(APPEND crashreporter-handler_LIBRARIES - crashreporter-breakpad -) - -add_library(crashreporter-handler STATIC ${crashreporter-handler_SOURCES}) -target_include_directories(crashreporter-handler PUBLIC ${crashreporter-handler_INCLUDE_DIRECTORIES}) -target_link_libraries(crashreporter-handler - ${crashreporter-handler_LIBRARIES} +target_link_libraries(crashreporter-handler PUBLIC + PkgConfig::BREAKPAD Qt5::Core) if(WIN32) - add_definitions( -DUNICODE ) #-fshort-wchar ) + target_compile_definitions(crashreporter-handler PRIVATE UNICODE _UNICODE) endif() |