Files
salmanoff/stimBuffApis/livoxGen1/CMakeLists.txt
T
hayodea 5845f1a41d Bug:Boost: Use shlibs instead of header-only for call_stack::top_
This symbol is defined as a static member object inside of a
boost detail header. When boost headers are used in a project
that uses Boost in both the main binary as well as dlopen()'d
shlibs, the top_ symbol gets duplicated and the metadata gets
partitioned.

We use the Boost shlib to unify both the main binary and the
shlibs to use the same memory address for top_.

This involves marking the templated object call_stack::top_ as
"extern" and then declaring to Boost that we intend to use the
shlibs.
2025-11-03 22:59:52 -04:00

44 lines
1.1 KiB
CMake

cmake_dependent_option(ENABLE_STIMBUFFAPI_livoxGen1
"Enable Livox Gen1 LiDAR stim buff API" ON
"ENABLE_LIB_livoxProto1" OFF)
if(ENABLE_STIMBUFFAPI_livoxGen1)
# Set CONFIG variable for config.h
set(CONFIG_STIMBUFFAPI_LIVOXGEN1_ENABLED 1)
# Find liburing using pkg-config
pkg_check_modules(URING REQUIRED liburing)
add_library(livoxGen1 SHARED
livoxGen1.cpp
stagingBuffer.cpp
pcloudStimulusBuffer.cpp
ioUringAssemblyEngine.cpp
)
target_include_directories(livoxGen1 PUBLIC
${Boost_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/commonLibs
${URING_INCLUDE_DIRS}
)
target_link_libraries(livoxGen1 PUBLIC
Boost::system
Boost::log
${URING_LIBRARIES}
attachmentSupport
)
target_link_directories(livoxGen1 PUBLIC
${URING_LIBRARY_DIRS}
)
# Verify Boost dynamic dependencies after build
add_custom_command(TARGET livoxGen1 POST_BUILD
COMMAND ${CMAKE_COMMAND} -DVERIFY_FILE="$<TARGET_FILE:livoxGen1>"
-P ${CMAKE_SOURCE_DIR}/cmake/VerifyBoostDynamic.cmake
COMMENT "Verifying Boost dynamic dependencies for livoxGen1"
)
# Install rules
install(TARGETS livoxGen1 DESTINATION lib)
endif()