Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Switch to using the vendored zstd library.
Browse files Browse the repository at this point in the history
We already have it vendored in the core as necessary.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
clalancette authored and MichaelOrlov committed Oct 18, 2022
1 parent 295ae9b commit b5ece09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
18 changes: 3 additions & 15 deletions mcap_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ endif()

## Dependencies
find_package(ament_cmake REQUIRED)
find_package(zstd_vendor REQUIRED)
find_package(zstd REQUIRED)


## Define vendor macro
Expand All @@ -30,39 +32,25 @@ macro(build_mcap_vendor)
)
fetchcontent_makeavailable(lz4)

fetchcontent_declare(zstd
GIT_REPOSITORY https://github.com/facebook/zstd.git
GIT_TAG e47e674cd09583ff0503f0f6defd6d23d8b718d3 # v1.5.2
)
fetchcontent_makeavailable(zstd)

file(GLOB _zstd_srcs
${zstd_SOURCE_DIR}/lib/common/*.c
${zstd_SOURCE_DIR}/lib/compress/*.c
${zstd_SOURCE_DIR}/lib/decompress/*.c
${zstd_SOURCE_DIR}/lib/decompress/*.S
)

file(GLOB _lz4_srcs
${lz4_SOURCE_DIR}/lib/*.c)

add_library(
mcap SHARED
src/main.cpp
${_zstd_srcs}
${_lz4_srcs}
)

set(_mcap_include_dir ${mcap_SOURCE_DIR}/cpp/mcap/include)

target_include_directories(mcap SYSTEM PRIVATE
${lz4_SOURCE_DIR}/lib
${zstd_SOURCE_DIR}/lib
)
target_include_directories(mcap SYSTEM PUBLIC
"$<BUILD_INTERFACE:${_mcap_include_dir}>"
"$<INSTALL_INTERFACE:include>"
)
target_link_libraries(mcap PRIVATE zstd::zstd)

install(
DIRECTORY
Expand Down
4 changes: 3 additions & 1 deletion mcap_vendor/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>git</buildtool_depend>


<depend>zstd_vendor</depend>

<test_depend>ament_cmake_clang_format</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
Expand Down

0 comments on commit b5ece09

Please sign in to comment.