From 6442b938eb5ccd9aa1bb9d771302b41072035a1e Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 14 Sep 2025 16:42:44 +0100 Subject: [PATCH] cmake: move zstd/cjson include handling Move the respective include_directories() stansas to the top-level cmakefile. While this technically adds them to targets where they are not needed, there is no harm is having them. This maskes the find_dependency/use_includes/use_libs more consistent across the board and helps it stand out where it's forgotten. Fixes for which will be coming at a later date. Signed-off-by: Emil Velikov --- CMakeLists.txt | 2 ++ src/core/CMakeLists.txt | 8 -------- src/plugins/relay/CMakeLists.txt | 2 -- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ecbb3df47..3eb78938e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -263,6 +263,7 @@ list(APPEND EXTRA_LIBS ${ZLIB_LIBRARY}) # Check for zstd if(ENABLE_ZSTD) pkg_check_modules(LIBZSTD REQUIRED libzstd) + include_directories(${LIBZSTD_INCLUDE_DIRS}) list(APPEND EXTRA_LIBS ${LIBZSTD_LDFLAGS}) add_definitions(-DHAVE_ZSTD) endif() @@ -270,6 +271,7 @@ endif() # Check for cJSON if(ENABLE_CJSON) pkg_check_modules(LIBCJSON REQUIRED libcjson) + include_directories(${LIBCJSON_INCLUDE_DIRS}) add_definitions(-DHAVE_CJSON) endif() diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 0f5747aeb..ea0ef1225 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -81,14 +81,6 @@ set(LIB_CORE_SRC include(CheckSymbolExists) check_symbol_exists(flock "sys/file.h" HAVE_FLOCK) -if(ENABLE_ZSTD) - include_directories(${LIBZSTD_INCLUDE_DIRS}) -endif() - -if(ENABLE_CJSON) - include_directories(${LIBCJSON_INCLUDE_DIRS}) -endif() - include_directories("${CMAKE_BINARY_DIR}") add_library(weechat_core OBJECT ${LIB_CORE_SRC}) target_link_libraries(weechat_core coverage_config) diff --git a/src/plugins/relay/CMakeLists.txt b/src/plugins/relay/CMakeLists.txt index a01d67176..adb390682 100644 --- a/src/plugins/relay/CMakeLists.txt +++ b/src/plugins/relay/CMakeLists.txt @@ -70,12 +70,10 @@ list(APPEND LINK_LIBS ${LIBGCRYPT_LDFLAGS}) list(APPEND LINK_LIBS ${ZLIB_LIBRARY}) if(ENABLE_ZSTD) - include_directories(${LIBZSTD_INCLUDE_DIRS}) list(APPEND LINK_LIBS ${LIBZSTD_LDFLAGS}) endif() if(ENABLE_CJSON) - include_directories(${LIBCJSON_INCLUDE_DIRS}) list(APPEND LINK_LIBS ${LIBCJSON_LDFLAGS}) endif()