diff --git a/CMakeLists.txt b/CMakeLists.txt index ec8a0e947f..fc6b351631 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