Skip to content

Commit bf89832

Browse files
flowergomkraj
authored andcommitted
rocksdb: support pkg-config based zstd detection
In Yocto builds, zstd is built via Makefile and does not install CMake package configuration files. As a result, Findzstd.cmake fails to detect ZSTD_INCLUDE_DIRS. Add pkg-config based detection as a fallback to properly locate zstd headers and libraries. Signed-off-by: Minjae Kim <flowergom@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 parent add2d94 commit bf89832

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From 7509f5d4bfcd8ba8bc0ad8c2054b2b336d8c0c9f Mon Sep 17 00:00:00 2001
2+
From: Minjae Kim <mj.kim@mercedes-benz.com>
3+
Date: Mon, 9 Feb 2026 20:34:53 +0000
4+
Subject: [PATCH] Findzstd.cmake: support pkg-config based zstd detection
5+
6+
In Yocto builds, zstd is built via Makefile and does not install
7+
CMake package configuration files. As a result, Findzstd.cmake
8+
fails to detect ZSTD_INCLUDE_DIRS.
9+
10+
Add pkg-config based detection as a fallback to properly locate
11+
zstd headers and libraries.
12+
13+
fix error:
14+
| Could NOT find zstd (missing: ZSTD_INCLUDE_DIRS)
15+
| Call Stack (most recent call first):
16+
17+
18+
Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/14308]
19+
20+
Signed-off-by: Minjae Kim <flowergom@gmail.com>
21+
22+
---
23+
cmake/modules/Findzstd.cmake | 4 ++++
24+
1 file changed, 4 insertions(+)
25+
26+
diff --git a/cmake/modules/Findzstd.cmake b/cmake/modules/Findzstd.cmake
27+
index e82fa148c8..f160be9ae0 100644
28+
--- a/cmake/modules/Findzstd.cmake
29+
+++ b/cmake/modules/Findzstd.cmake
30+
@@ -14,6 +14,10 @@ find_library(ZSTD_LIBRARIES
31+
HINTS ${zstd_ROOT_DIR}/lib)
32+
33+
include(FindPackageHandleStandardArgs)
34+
+find_package(PkgConfig QUIET)
35+
+if(PKG_CONFIG_FOUND)
36+
+ pkg_check_modules(ZSTD QUIET libzstd)
37+
+endif()
38+
find_package_handle_standard_args(zstd DEFAULT_MSG ZSTD_LIBRARIES ZSTD_INCLUDE_DIRS)
39+
40+
mark_as_advanced(
41+
--
42+
2.43.0
43+

meta-oe/recipes-dbs/rocksdb/rocksdb_9.10.0.bb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH};protocol=htt
2222
file://run-ptest \
2323
file://0001-Fix-build-error-with-gcc-13-by-adding-cstdint-header.patch \
2424
file://0001-checkpoint.h-Add-missing-includes-cstdint.patch \
25+
file://0001-Findzstd.cmake-support-pkg-config-based-zstd-detecti.patch \
2526
"
2627

2728
SRC_URI:append:riscv32 = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch"

0 commit comments

Comments
 (0)