Skip to content

Commit

Permalink
Only set OPENSSL_DIR for Rust build if it is actually defined
Browse files Browse the repository at this point in the history
  • Loading branch information
micahsnyder committed Dec 13, 2024
1 parent 88e80d9 commit c5ad69a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libclamav_rust/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$<TARGET_PROPERTY:ClamAV::libclamav,INCLUDE_DIRECTORIES>"
# Tests cannot be pre-compiled here, because there are circular dependencies
# between libclamav_rust and libclamav to include calls like `cli_getdsig()`
Expand Down

0 comments on commit c5ad69a

Please sign in to comment.