Skip to content

Commit c0e9791

Browse files
Marcel Lauhoffirq0
authored andcommitted
cmake: build and link breakpad
Signed-off-by: Marcel Lauhoff <[email protected]>
1 parent e1bde02 commit c0e9791

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

src/CMakeLists.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,43 @@ if (WITH_BLKIN)
325325
add_subdirectory(blkin/blkin-lib)
326326
endif(WITH_BLKIN)
327327

328+
## breakpad
329+
set(breakpad_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/breakpad)
330+
set(lss_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/lss)
331+
332+
add_custom_target(breakpad_lss_symlink)
333+
add_custom_command(
334+
TARGET breakpad_lss_symlink
335+
COMMAND ${CMAKE_COMMAND} -E create_symlink ${lss_SOURCE_DIR} ${breakpad_SOURCE_DIR}/src/third_party/lss
336+
COMMENT "Creating symbolic link lss -> breakpad third party"
337+
)
338+
ExternalProject_Add(
339+
breakpad_project
340+
SOURCE_DIR "${breakpad_SOURCE_DIR}"
341+
CONFIGURE_COMMAND
342+
/bin/sh -cx "cd ${breakpad_SOURCE_DIR} && ./configure"
343+
BUILD_COMMAND
344+
/bin/sh -cx "cd ${breakpad_SOURCE_DIR} && make"
345+
INSTALL_COMMAND ""
346+
UPDATE_DISCONNECTED ON
347+
BUILD_IN_SOURCE ON
348+
DEPENDS breakpad_lss_symlink
349+
BUILD_BYPRODUCTS "${breakpad_SOURCE_DIR}/src/libbreakpad.a;${breakpad_SOURCE_DIR}/src/client/linux/libbreakpad_client.a"
350+
)
351+
352+
add_library(libbreakpad STATIC IMPORTED GLOBAL)
353+
set_property(TARGET libbreakpad PROPERTY IMPORTED_LOCATION ${breakpad_SOURCE_DIR}/src/libbreakpad.a)
354+
add_library(libbreakpad_client STATIC IMPORTED GLOBAL)
355+
set_property(TARGET libbreakpad_client PROPERTY IMPORTED_LOCATION ${breakpad_SOURCE_DIR}/src/client/linux/libbreakpad_client.a)
356+
357+
include_directories(SYSTEM "${breakpad_SOURCE_DIR}/src")
358+
add_dependencies(libbreakpad breakpad_project)
359+
add_dependencies(libbreakpad_client breakpad_project)
360+
361+
add_library(breakpad INTERFACE)
362+
target_link_libraries(breakpad INTERFACE libbreakpad libbreakpad_client)
363+
364+
328365
if(WITH_JAEGER)
329366
find_package(thrift 0.13.0 REQUIRED)
330367
include(BuildOpentelemetry)
@@ -481,6 +518,9 @@ if(WITH_JAEGER)
481518
target_link_libraries(common-objs jaeger_base)
482519
endif()
483520

521+
add_dependencies(common-objs breakpad_project)
522+
target_link_libraries(common-objs breakpad)
523+
484524
CHECK_C_COMPILER_FLAG("-fvar-tracking-assignments" HAS_VTA)
485525
add_subdirectory(auth)
486526
add_subdirectory(common)
@@ -542,6 +582,8 @@ if(WITH_JAEGER)
542582
list(APPEND ceph_common_deps jaeger_base)
543583
endif()
544584

585+
list(APPEND ceph_common_deps breakpad)
586+
545587
if(WIN32)
546588
list(APPEND ceph_common_deps ws2_32 mswsock iphlpapi bcrypt)
547589
list(APPEND ceph_common_deps dlfcn_win32)
@@ -578,6 +620,8 @@ if(WITH_JAEGER)
578620
add_dependencies(common jaeger_base)
579621
endif()
580622

623+
add_dependencies(common breakpad_project)
624+
581625
if (WIN32)
582626
# Statically building ceph-common on Windows fails. We're temporarily
583627
# reverting this: 22fefb2338cfc4fcb03ece3cbf77aa964a7f17f2
@@ -597,6 +641,8 @@ if(WITH_JAEGER)
597641
add_dependencies(ceph-common jaeger_base)
598642
endif()
599643

644+
add_dependencies(ceph-common breakpad_project)
645+
600646
# appease dpkg-shlibdeps
601647
set_target_properties(ceph-common PROPERTIES
602648
SOVERSION 2

src/crimson/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ if(WITH_JAEGER)
137137
list(APPEND crimson_common_public_deps jaeger_base)
138138
endif()
139139

140+
list(APPEND crimson_common_public_deps breakpad)
141+
140142
if(NOT WITH_SYSTEM_BOOST)
141143
list(APPEND crimson_common_deps ${ZLIB_LIBRARIES})
142144
endif()

src/rgw/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ if(WITH_JAEGER)
358358
target_link_libraries(rgw_common PUBLIC jaeger_base)
359359
endif()
360360

361+
add_dependencies(rgw_common breakpad_project)
362+
target_link_libraries(rgw_common PUBLIC breakpad)
363+
361364
if(WITH_RADOSGW_DBSTORE)
362365
target_link_libraries(rgw_common PRIVATE global dbstore)
363366
endif()

0 commit comments

Comments
 (0)