From d9db8401e202ec31f410560d0e9f3ba3b5bdb70a Mon Sep 17 00:00:00 2001 From: Nobutaka Mantani <2285962+nmantani@users.noreply.github.com> Date: Mon, 11 Jan 2021 02:52:00 +0900 Subject: [PATCH] Fix build on FreeBSD (#126) * Fix build on FreeBSD * Use more generic way to search libcrypto * Integrate macro for FreeBSD --- CMakeLists.txt | 5 ++++- plugins/libimhex/include/helpers/utils.hpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31e664886..a923f3a10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,10 @@ set(Python_FIND_FRAMEWORK NEVER) # Find packages find_package(PkgConfig REQUIRED) -pkg_search_module(CRYPTO REQUIRED libcrypto) +pkg_search_module(CRYPTO libcrypto) +if(NOT CRYPTO_FOUND) + find_library(CRYPTO crypto REQUIRED) +endif() pkg_search_module(CAPSTONE REQUIRED capstone) find_package(OpenGL REQUIRED) find_package(nlohmann_json REQUIRED) diff --git a/plugins/libimhex/include/helpers/utils.hpp b/plugins/libimhex/include/helpers/utils.hpp index 3d5855145..9259ec107 100644 --- a/plugins/libimhex/include/helpers/utils.hpp +++ b/plugins/libimhex/include/helpers/utils.hpp @@ -17,7 +17,7 @@ #include #endif -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__FreeBSD__) #define off64_t off_t #define fopen64 fopen #define fseeko64 fseek