Skip to content

Commit

Permalink
CMake: Add Haiku (BeOS-like) support
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca1991 authored Oct 18, 2023
1 parent 14d7d21 commit ac6389d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions libfreshclam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ac6389d

Please sign in to comment.