From c5ad69a4df77194644a7e50d83b214752f94b92d Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Fri, 13 Dec 2024 15:21:09 -0500 Subject: [PATCH] Only set OPENSSL_DIR for Rust build if it is actually defined --- libclamav_rust/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libclamav_rust/CMakeLists.txt b/libclamav_rust/CMakeLists.txt index 74f22ce930..bae604db0c 100644 --- a/libclamav_rust/CMakeLists.txt +++ b/libclamav_rust/CMakeLists.txt @@ -4,11 +4,18 @@ # Copyright (C) 2021-2024 Cisco Systems, Inc. and/or its affiliates. All rights reserved. # +# if OPENSSL_ROOT_DIR is set, pass it to the environment +if(OPENSSL_ROOT_DIR) + set(ENVIRONMENT "OPENSSL_DIR=${OPENSSL_ROOT_DIR}") +else () + set(ENVIRONMENT "") +endif() + # libclamav rust static library add_rust_library(TARGET clamav_rust SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" BINARY_DIRECTORY "${CMAKE_BINARY_DIR}" - ENVIRONMENT "OPENSSL_DIR=${OPENSSL_ROOT_DIR}" + ENVIRONMENT "${ENVIRONMENT}" INCLUDE_DIRECTORIES "$" # Tests cannot be pre-compiled here, because there are circular dependencies # between libclamav_rust and libclamav to include calls like `cli_getdsig()`