Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: fix libclamav-only mode build when tests are enable #714

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ if(WIN32)
file(TO_NATIVE_PATH $<TARGET_FILE:BZip2::BZip2> LIBBZ2)
file(TO_NATIVE_PATH $<TARGET_FILE:PCRE2::pcre2> LIBPCRE2)
file(TO_NATIVE_PATH $<TARGET_FILE:LibXml2::LibXml2> LIBXML2)
file(TO_NATIVE_PATH $<TARGET_FILE:CURL::libcurl> LIBCURL)
if(NOT ENABLE_LIBCLAMAV_ONLY)
# libcurl not used by libclamav and so is not defined in libclamav-only mode.
file(TO_NATIVE_PATH $<TARGET_FILE:CURL::libcurl> LIBCURL)
endif()
file(TO_NATIVE_PATH $<TARGET_FILE:JSONC::jsonc> LIBJSONC)
file(TO_NATIVE_PATH $<TARGET_FILE:PThreadW32::pthreadw32> LIBPTHREADW32)
file(TO_NATIVE_PATH $<TARGET_FILE:ClamAV::win32_compat> LIBWIN32COMPAT)
Expand Down Expand Up @@ -245,7 +248,10 @@ else()
set(LIBBZ2 $<TARGET_FILE:BZip2::BZip2>)
set(LIBPCRE2 $<TARGET_FILE:PCRE2::pcre2>)
set(LIBXML2 $<TARGET_FILE:LibXml2::LibXml2>)
set(LIBCURL $<TARGET_FILE:CURL::libcurl>)
if(NOT ENABLE_LIBCLAMAV_ONLY)
# libcurl not used by libclamav and so is not defined in libclamav-only mode.
set(LIBCURL $<TARGET_FILE:CURL::libcurl>)
endif()
set(LIBJSONC $<TARGET_FILE:JSONC::jsonc>)
if(Iconv_FOUND AND NOT Iconv_IS_BUILT_IN)
set(LIBICONV ${Iconv_LIBRARIES})
Expand Down