]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: Make breakpad build conditional (WITH_BREAKPAD)
authorMarcel Lauhoff <marcel.lauhoff@clyso.com>
Thu, 16 Jan 2025 09:18:02 +0000 (10:18 +0100)
committerMarcel Lauhoff <marcel.lauhoff@clyso.com>
Tue, 13 May 2025 10:39:46 +0000 (12:39 +0200)
Add option WITH_BREAKPAD defaulting to TRUE on non-windows platforms.

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@clyso.com>
CMakeLists.txt
src/CMakeLists.txt
src/crimson/CMakeLists.txt
src/include/config-h.in.cmake
src/rgw/CMakeLists.txt

index 8ded471e2ded19934a2310df5dbed14ddd3c18cb..472f87787d0d60c869933bb597ed6d73384605ed 100644 (file)
@@ -539,6 +539,18 @@ if(WITH_CATCH2)
   message("-- Enabled Catch2 support")
 endif()
 
+if(WIN32)
+    set(WITH_BREAKPAD_DEFAULT OFF)
+else()
+    set(WITH_BREAKPAD_DEFAULT ON)
+endif()
+
+option(WITH_BREAKPAD "Build with Google Breakpad crash reporter"  ${WITH_BREAKPAD_DEFAULT})
+if(WITH_BREAKPAD)
+  set(HAVE_BREAKPAD ON)
+  message("-- Enabled Google Breakpad crash reporter")
+endif()
+
 #option for RGW
 option(WITH_RADOSGW "RADOS Gateway is enabled" ON)
 option(WITH_RADOSGW_BEAST_OPENSSL "RADOS Gateway's Beast frontend uses OpenSSL" ON)
index 124e5ff90638788d9e799b1fdc8b681fbdb504bb..97683ee533358b18682d548e52fea3f6ad2f63fe 100644 (file)
@@ -326,16 +326,17 @@ if (WITH_BLKIN)
 endif(WITH_BLKIN)
 
 ## breakpad
-set(breakpad_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/breakpad)
-set(lss_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/lss)
+if(WITH_BREAKPAD)
+  set(breakpad_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/breakpad)
+  set(lss_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/lss)
 
-add_custom_target(breakpad_lss_symlink)
-add_custom_command(
+  add_custom_target(breakpad_lss_symlink)
+  add_custom_command(
     TARGET breakpad_lss_symlink
     COMMAND ${CMAKE_COMMAND} -E create_symlink ${lss_SOURCE_DIR} ${breakpad_SOURCE_DIR}/src/third_party/lss
     COMMENT "Creating symbolic link lss -> breakpad third party"
-)
-ExternalProject_Add(
+  )
+  ExternalProject_Add(
     breakpad_project
     SOURCE_DIR "${breakpad_SOURCE_DIR}"
     CONFIGURE_COMMAND
@@ -347,20 +348,20 @@ ExternalProject_Add(
     BUILD_IN_SOURCE ON
     DEPENDS breakpad_lss_symlink
     BUILD_BYPRODUCTS "${breakpad_SOURCE_DIR}/src/libbreakpad.a;${breakpad_SOURCE_DIR}/src/client/linux/libbreakpad_client.a"
-)
-
-add_library(libbreakpad STATIC IMPORTED GLOBAL)
-set_property(TARGET libbreakpad PROPERTY IMPORTED_LOCATION ${breakpad_SOURCE_DIR}/src/libbreakpad.a)
-add_library(libbreakpad_client STATIC IMPORTED GLOBAL)
-set_property(TARGET libbreakpad_client PROPERTY IMPORTED_LOCATION ${breakpad_SOURCE_DIR}/src/client/linux/libbreakpad_client.a)
+  )
 
-include_directories(SYSTEM "${breakpad_SOURCE_DIR}/src")
-add_dependencies(libbreakpad breakpad_project)
-add_dependencies(libbreakpad_client breakpad_project)
+  add_library(libbreakpad STATIC IMPORTED GLOBAL)
+  set_property(TARGET libbreakpad PROPERTY IMPORTED_LOCATION ${breakpad_SOURCE_DIR}/src/libbreakpad.a)
+  add_library(libbreakpad_client STATIC IMPORTED GLOBAL)
+  set_property(TARGET libbreakpad_client PROPERTY IMPORTED_LOCATION ${breakpad_SOURCE_DIR}/src/client/linux/libbreakpad_client.a)
 
-add_library(breakpad INTERFACE)
-target_link_libraries(breakpad INTERFACE libbreakpad libbreakpad_client)
+  include_directories(SYSTEM "${breakpad_SOURCE_DIR}/src")
+  add_dependencies(libbreakpad breakpad_project)
+  add_dependencies(libbreakpad_client breakpad_project)
 
+  add_library(breakpad INTERFACE)
+  target_link_libraries(breakpad INTERFACE libbreakpad libbreakpad_client)
+endif(WITH_BREAKPAD)
 
 if(WITH_JAEGER)
   find_package(thrift 0.13.0 REQUIRED)
@@ -518,8 +519,10 @@ if(WITH_JAEGER)
   target_link_libraries(common-objs jaeger_base)
 endif()
 
-add_dependencies(common-objs breakpad_project)
-target_link_libraries(common-objs breakpad)
+if(WITH_BREAKPAD)
+  add_dependencies(common-objs breakpad_project)
+  target_link_libraries(common-objs breakpad)
+endif()
 
 CHECK_C_COMPILER_FLAG("-fvar-tracking-assignments" HAS_VTA)
 add_subdirectory(auth)
@@ -582,7 +585,9 @@ if(WITH_JAEGER)
   list(APPEND ceph_common_deps jaeger_base)
 endif()
 
-list(APPEND ceph_common_deps breakpad)
+if(WITH_BREAKPAD)
+  list(APPEND ceph_common_deps breakpad)
+endif()
 
 if(WIN32)
   list(APPEND ceph_common_deps ws2_32 mswsock iphlpapi bcrypt)
@@ -620,7 +625,9 @@ if(WITH_JAEGER)
 add_dependencies(common jaeger_base)
 endif()
 
+if(WITH_BREAKPAD)
 add_dependencies(common breakpad_project)
+endif()
 
 if (WIN32)
   # Statically building ceph-common on Windows fails. We're temporarily
@@ -641,7 +648,9 @@ if(WITH_JAEGER)
 add_dependencies(ceph-common jaeger_base)
 endif()
 
+if(WITH_BREAKPAD)
 add_dependencies(ceph-common breakpad_project)
+endif()
 
 # appease dpkg-shlibdeps
 set_target_properties(ceph-common PROPERTIES
index dbf564ddd49e58953bd80022fc97dd3cd5fda138..09903ff7954423074d1341008e945df2ddd95cc7 100644 (file)
@@ -137,7 +137,9 @@ if(WITH_JAEGER)
   list(APPEND crimson_common_public_deps jaeger_base)
 endif()
 
-list(APPEND crimson_common_public_deps breakpad)
+if(WITH_BREAKPAD)
+  list(APPEND crimson_common_public_deps breakpad)
+endif()
 
 if(NOT WITH_SYSTEM_BOOST)
   list(APPEND crimson_common_deps ${ZLIB_LIBRARIES})
index bc85aac22ee978b7cebe1531d8be55706fd325c6..35e85573e43f4d5d201881e414681ac83eb1c4ec 100644 (file)
 /* libexec directory path */
 #cmakedefine CMAKE_INSTALL_LIBEXECDIR "@CMAKE_INSTALL_LIBEXECDIR@"
 
+/* Define if breakpad is available */
+#cmakedefine HAVE_BREAKPAD
+
 #endif /* CONFIG_H */
index 568c17ea56dc5165b34e572d423fd6a7e262e7a9..3b294bf157161d80072c88ac4a658a7ca54f641e 100644 (file)
@@ -358,8 +358,10 @@ if(WITH_JAEGER)
   target_link_libraries(rgw_common PUBLIC jaeger_base)
 endif()
 
-add_dependencies(rgw_common breakpad_project)
-target_link_libraries(rgw_common PUBLIC breakpad)
+if(WITH_BREAKPAD)
+  add_dependencies(rgw_common breakpad_project)
+  target_link_libraries(rgw_common PUBLIC breakpad)
+endif()
 
 if(WITH_RADOSGW_DBSTORE)
   target_link_libraries(rgw_common PRIVATE global dbstore)