From fe2aa0638ee01aa4159cb895d59061efc7b820b4 Mon Sep 17 00:00:00 2001 From: shenlebantongying Date: Tue, 2 Jul 2024 16:55:12 -0400 Subject: [PATCH] feat: breakpad support for cmake/vcpkg build --- CMakeLists.txt | 9 +++++++++ cmake/Deps_Vcpkg.cmake | 5 +++++ website/docs/howto/build_from_source.md | 1 + 3 files changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 33bf4be3..e5b2de35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ option(USE_SYSTEM_TOML "use system toml++ instead of bundled one" OFF) # vcpkg build - only tested on Windows, does not support FFMPEG option(USE_VCPKG "uses VCPKG for providing dependencies" OFF) +option(WITH_VCPKG_BREAKPAD "build with Breakpad support for VCPKG build only" OFF) ## Change binary & resources folder to parallel install with original GD. ## This flag should be avoided because it leads to small regressions: @@ -21,6 +22,10 @@ option(USE_ALTERNATIVE_NAME "Force the name goldendict-ng " OFF) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}") # to put staff in the ./cmake folder +if(WITH_VCPKG_BREAKPAD) + list(APPEND VCPKG_MANIFEST_FEATURES "breakpad") +endif() + include(FeatureSummary) project(goldendict-ng @@ -192,6 +197,10 @@ if (WITH_ZIM) target_compile_definitions(${GOLDENDICT} PUBLIC MAKE_ZIM_SUPPORT) endif () +if (WITH_VCPKG_BREAKPAD) + target_compile_definitions(${GOLDENDICT} PUBLIC USE_BREAKPAD) +endif () + #### libraries linking && includes for Win or Unix if (USE_VCPKG) diff --git a/cmake/Deps_Vcpkg.cmake b/cmake/Deps_Vcpkg.cmake index c189c23d..1f4eb50c 100644 --- a/cmake/Deps_Vcpkg.cmake +++ b/cmake/Deps_Vcpkg.cmake @@ -24,6 +24,11 @@ target_link_libraries(${GOLDENDICT} ZLIB::ZLIB ) +if (WITH_VCPKG_BREAKPAD) + find_package(unofficial-breakpad REQUIRED) + target_link_libraries(${GOLDENDICT} PRIVATE unofficial::breakpad::libbreakpad_client) +endif () + if (WITH_EPWING_SUPPORT) add_subdirectory(thirdparty/eb EXCLUDE_FROM_ALL) target_include_directories(${GOLDENDICT} PRIVATE diff --git a/website/docs/howto/build_from_source.md b/website/docs/howto/build_from_source.md index 2439ca44..99f6fe65 100644 --- a/website/docs/howto/build_from_source.md +++ b/website/docs/howto/build_from_source.md @@ -91,6 +91,7 @@ Add this to cmake command: Most `.dll` built by vcpkg will be automatically copied, but the Qt ones won't. You can + * run `cmake --install .` (recommended) * manually run windeployqt * add `${Qt's install path}\Qt\6.5.2\msvc2019_64\bin` to your PATH environment variable