cmake-native uses the system provided libraries due to:

CMAKE_EXTRACONF = "<...> -DCMAKE_USE_SYSTEM_LIBRARIES=1 <...>"

Now, iff the libzstd(-dev) is installed but too old, which can happen on Ubuntu 
16.04:

dpkg -l | grep zstd
ii  libzstd-dev  0.5.1-1
ii  libzstd0 0.5.1-1

cmake configure will use the zstd system library:

cat ./tmp/work/x86_64-linux/cmake-native/3.15.3-r0/temp/log.do_configure | grep 
-i ZSTD
-- Using system-installed ZSTD
-- Found ZSTD: /usr/lib/x86_64-linux-gnu/libzstd.so

but will fail to compile due to:

<...>/tmp/work/x86_64-linux/cmake-native/3.15.3-r0/cmake-3.15.3/Utilities/cmlibarchive/libarchive/archive_read_support_filter_zstd.c:59:2:
 error: unknown type name ‘ZSTD_DStream’
|   ZSTD_DStream *dstream;
|   ^

The library does not contain that datatype:

grep -rne ZSTD_DStream /usr/include/zstd.h
<no output>

Apparently the cmake-native library check is not checking the library version 
or features.

This fix is to not depend on the system library and use the zstd library 
provided with cmake.

CMAKE_EXTRACONF = "\
<...>
    -DCMAKE_USE_SYSTEM_LIBRARY_ZSTD=0 \
<...>

Signed-off-by: Leon Woestenberg <[email protected]>
---
 meta/recipes-devtools/cmake/cmake-native_3.16.5.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb 
b/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb
index b2952ee..e0ac3f8 100644
--- a/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb
+++ b/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb
@@ -21,6 +21,7 @@ CMAKE_EXTRACONF = "\
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_ZSTD=0 \
     -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \
     -DHAVE_SYS_ACL_H=0 \
 "
-- 
2.7.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#141461): 
https://lists.openembedded.org/g/openembedded-core/message/141461
Mute This Topic: https://lists.openembedded.org/mt/76196110/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to