From f6b6f05c8b91cbf99930adaec9f12126e69b8d2e Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Mon, 29 Apr 2019 20:53:28 -0700 Subject: [PATCH] Check availability of common crypto library for mac. #384 --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e6249fc..0125aff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -261,7 +261,13 @@ if(UNIX) if ((MZ_PKCRYPT OR MZ_WZAES) AND NOT (MZ_OPENSSL AND OPENSSL_FOUND)) if (APPLE AND NOT MZ_BRG) - list(APPEND MINIZIP_SRC "mz_crypt_apple.c") + check_include_files(CommonCrypto/CommonCrypto.h COMMONCRYPTO_FOUND) + if (COMMONCRYPTO_FOUND) + list(APPEND MINIZIP_SRC "mz_crypt_apple.c") + else() + message(STATUS "CommonCrypto not found, using BRG instead") + set(MZ_BRG TRUE) + endif() else() set(MZ_BRG TRUE) endif()