From 0ee4b1e336d0d4be9509d663a8e78830017006f3 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 14 Dec 2021 21:27:15 +0100 Subject: [PATCH] build: Link mbedtls to libyara --- external/yara/CMakeLists.txt | 7 +++++-- plugins/libimhex/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/external/yara/CMakeLists.txt b/external/yara/CMakeLists.txt index 5457991e1..c162ef23a 100644 --- a/external/yara/CMakeLists.txt +++ b/external/yara/CMakeLists.txt @@ -104,6 +104,7 @@ add_compile_definitions("MAGIC_MODULE") add_compile_definitions("MACHO_MODULE") add_compile_definitions("DEX_MODULE") +find_package(mbedTLS 2.26.0 REQUIRED) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-shift-count-overflow") add_library(libyara STATIC ${LIBYARA_SOURCE} ${LIBYARA_INCLUDES} ${LIBYARA_MODULES}) @@ -115,10 +116,12 @@ target_include_directories( PRIVATE ${LIBYARA_SOURCE_PATH} ${MBEDTLS_INCLUDE_DIR} ) +target_link_directories(libyara PRIVATE ${MBEDTLS_LIBRARY_DIR}) + if (UNIX) - target_link_libraries(libyara magic pthread) + target_link_libraries(libyara PRIVATE magic ${MBEDTLS_LIBRARIES} pthread) else () - target_link_libraries(libyara magic) + target_link_libraries(libyara PRIVATE magic ${MBEDTLS_LIBRARIES}) endif () include(GNUInstallDirs) diff --git a/plugins/libimhex/CMakeLists.txt b/plugins/libimhex/CMakeLists.txt index ad6122ff7..dfd91d608 100644 --- a/plugins/libimhex/CMakeLists.txt +++ b/plugins/libimhex/CMakeLists.txt @@ -126,7 +126,7 @@ endif () add_library(libimhex SHARED ${LIBIMHEX_SOURCES}) -target_include_directories(libimhex PUBLIC include ${MBEDTLS_INCLUDE_DIR} ${XDGPP_INCLUDE_DIRS} ${MBEDTLS_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${FMT_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} ${YARA_INCLUDE_DIRS}) +target_include_directories(libimhex PUBLIC include ${XDGPP_INCLUDE_DIRS} ${MBEDTLS_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${FMT_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} ${YARA_INCLUDE_DIRS}) target_link_directories(libimhex PUBLIC ${MBEDTLS_LIBRARY_DIR} ${CAPSTONE_LIBRARY_DIRS} ${MAGIC_LIBRARY_DIRS}) if (APPLE)