@cryptotaxi247 / netdata-1 / commits / 348030fe9

Fix handling of LZ4 dependency version. (#21669)

* Fix handling of LZ4 dependency version. The strange split in how we handle our LZ4 dependency in the build system is an artefact of now removed features that depended on version 1.9 or later, combined with a lack of understanding of the evolution of the liblz4 API over the years. With the current state of things, none of our LZ4 dependent code actually gets built unless we find LZ4 version 1.9 or newer despite our checking for an older version afterwards, and we don’t actually depend on anything in the API that’s newer than version 1.7.1. Given this, just check for LZ4 version 1.7.1 or newer and don’t try any fallback checks. The only functional effect of this change aside from declaring our dependencies properly is that LZ4 support will be available on a small handful of systems it was not previously available on. * Correctly handle LZ4 as optional at configure time.

Austin S. Hemmelgarn committed Feb 10, 2026 at 07:36 UTC 348030fe9d7faa075404ad89cb079129e7fc3cbc
1 file changed +7 -11
CMakeLists.txt
+7 -11
@@ -2375,19 +2375,15 @@ else()
2375 target_link_libraries(libnetdata PUBLIC ${ZLIB_LDFLAGS})
2376 endif()
2377
2378 -# lz4 - try to find a version that is compatible with streaming compression
2379 -# otherwise pick whichever one we can find to support dbengine but don't set
2380 -# ENABLE_LZ4.
2381 -pkg_check_modules(LIBLZ4 liblz4>=1.9.0)
2378 +# lz4
2379 +pkg_check_modules(LIBLZ4 REQUIRED liblz4>=1.7.1)
2380 if(LIBLZ4_FOUND)
2383 - set(ENABLE_LZ4 On)
2384 -else()
2385 - pkg_check_modules(LIBLZ4 REQUIRED liblz4)
2386 -endif()
2381 + set(ENABLE_LZ4 On)
2382
2388 -target_include_directories(libnetdata BEFORE PUBLIC ${LIBLZ4_INCLUDE_DIRS})
2389 -target_compile_options(libnetdata PUBLIC ${LIBLZ4_CFLAGS_OTHER})
2390 -target_link_libraries(libnetdata PUBLIC ${LIBLZ4_LDFLAGS})
2383 + target_include_directories(libnetdata BEFORE PUBLIC ${LIBLZ4_INCLUDE_DIRS})
2384 + target_compile_options(libnetdata PUBLIC ${LIBLZ4_CFLAGS_OTHER})
2385 + target_link_libraries(libnetdata PUBLIC ${LIBLZ4_LDFLAGS})
2386 +endif()
2387
2388 # zstd
2389 pkg_check_modules(LIBZSTD libzstd)