2021-04-21 16:24:24 -07:00
|
|
|
#
|
|
|
|
# libclamav features written in Rust
|
|
|
|
#
|
2025-02-14 10:24:30 -05:00
|
|
|
# Copyright (C) 2021-2025 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
|
2021-10-18 14:56:09 -04:00
|
|
|
#
|
2021-04-21 16:24:24 -07:00
|
|
|
|
|
|
|
# libclamav rust static library
|
2022-09-06 09:18:44 -07:00
|
|
|
add_rust_library(TARGET clamav_rust
|
2022-09-07 13:44:03 -07:00
|
|
|
SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
|
|
BINARY_DIRECTORY "${CMAKE_BINARY_DIR}"
|
2023-12-06 16:17:13 -05:00
|
|
|
INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:ClamAV::libclamav,INCLUDE_DIRECTORIES>"
|
2022-09-06 09:18:44 -07:00
|
|
|
# Tests cannot be pre-compiled here, because there are circular dependencies
|
|
|
|
# between libclamav_rust and libclamav to include calls like `cli_getdsig()`
|
|
|
|
# as well as the logging functions.
|
|
|
|
PRECOMPILE_TESTS FALSE
|
|
|
|
)
|
2021-08-23 13:38:26 -04:00
|
|
|
if (WIN32)
|
2021-10-18 14:56:09 -04:00
|
|
|
target_link_libraries(clamav_rust PUBLIC INTERFACE Userenv)
|
2021-08-23 13:38:26 -04:00
|
|
|
endif()
|
2021-11-17 14:45:25 -08:00
|
|
|
|
2023-12-01 07:19:39 +08:00
|
|
|
if(WIN32)
|
|
|
|
install(FILES $<TARGET_FILE:clamav_rust> DESTINATION . COMPONENT libraries)
|
|
|
|
else()
|
|
|
|
install(FILES $<TARGET_FILE:clamav_rust> DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
|
|
|
|
endif()
|
|
|
|
|
2021-04-21 16:24:24 -07:00
|
|
|
add_library(ClamAV::libclamav_rust ALIAS clamav_rust)
|