From 03dfa17483fe0589adf1caa0c6c2a335d95380bc Mon Sep 17 00:00:00 2001 From: Luca D'Amico Date: Wed, 18 Oct 2023 13:11:54 +0000 Subject: [PATCH] Add Haiku (BeOS-like) support --- CMakeLists.txt | 6 ++++-- libfreshclam/CMakeLists.txt | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec8a0e947f..2144700287 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -610,8 +610,10 @@ foreach(_cxx1x_flag -std=c++14 -std=c++11) endif() endforeach() -# Always use '-fPIC'/'-fPIE' option. -set(CMAKE_POSITION_INDEPENDENT_CODE ON) +# Always use '-fPIC'/'-fPIE' option if OS is not Haiku. +if(NOT HAIKU) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) +endif() # Checks for header files. include(CheckIncludeFile) diff --git a/libfreshclam/CMakeLists.txt b/libfreshclam/CMakeLists.txt index 01b456c30b..218d74c320 100644 --- a/libfreshclam/CMakeLists.txt +++ b/libfreshclam/CMakeLists.txt @@ -48,6 +48,10 @@ if(ENABLE_SHARED_LIB) resolv ${APPLE_CORE_FOUNDATION} ${APPLE_SECURITY} ) + elseif(HAIKU) + target_link_libraries( freshclam + PUBLIC + network ) elseif(UNIX) if(HAVE_RESOLV_H AND NOT C_BSD) # BSD appears to have libresolv inside libc target_link_libraries( freshclam @@ -128,6 +132,10 @@ if(ENABLE_STATIC_LIB) resolv ${APPLE_CORE_FOUNDATION} ${APPLE_SECURITY} ) + elseif(HAIKU) + target_link_libraries( freshclam_static + PUBLIC + network ) elseif(UNIX) if(HAVE_RESOLV_H AND NOT C_BSD) # BSD appears to have libresolv inside libc target_link_libraries( freshclam_static