@@ -30,6 +30,8 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
3030 set (DragonFly TRUE CACHE BOOL "..." FORCE)
3131elseif ("${CMAKE_SYSTEM_NAME} " STREQUAL "SunOS" )
3232 set (SunOS TRUE CACHE BOOL "..." FORCE)
33+ elseif ("${CMAKE_SYSTEM_NAME} " STREQUAL "Haiku" )
34+ set (Haiku TRUE CACHE BOOL "..." FORCE)
3335elseif (NOT APPLE AND NOT WIN32 )
3436 message (FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME} " )
3537endif ()
@@ -139,7 +141,7 @@ set(WARNING_FLAGS "-Wall -Wextra -Wconversion -Werror=uninitialized -Werror=retu
139141set (CMAKE_C_STANDARD 11)
140142set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} -Werror=incompatible-pointer-types -Werror=implicit-function-declaration -Werror=int-conversion" )
141143
142- if (WIN32 OR ENABLE_DIRECTX_HEADERS)
144+ if (WIN32 OR HAIKU OR ENABLE_DIRECTX_HEADERS)
143145 enable_language (CXX)
144146 set (CMAKE_CXX_STANDARD 17)
145147 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} " )
@@ -1088,6 +1090,74 @@ elseif(SunOS)
10881090 src/util/platform/FFPlatform_unix.c
10891091 src/util/binary_linux.c
10901092 )
1093+ elseif (Haiku)
1094+ list (APPEND LIBFASTFETCH_SRC
1095+ src/common/io/io_unix.c
1096+ src/common/netif/netif_haiku.c
1097+ src/common/networking_linux.c
1098+ src/common/processing_linux.c
1099+ src/detection/battery/battery_nosupport.c
1100+ src/detection/bios/bios_nosupport.c
1101+ src/detection/board/board_nosupport.c
1102+ src/detection/bootmgr/bootmgr_nosupport.c
1103+ src/detection/brightness/brightness_nosupport.c
1104+ src/detection/btrfs/btrfs_nosupport.c
1105+ src/detection/chassis/chassis_nosupport.c
1106+ src/detection/cpu/cpu_nosupport.c
1107+ src/detection/cpucache/cpucache_nosupport.c
1108+ src/detection/cpuusage/cpuusage_nosupport.c
1109+ src/detection/cursor/cursor_nosupport.c
1110+ src/detection/bluetooth/bluetooth_nosupport.c
1111+ src/detection/bluetoothradio/bluetoothradio_nosupport.c
1112+ src/detection/disk/disk_nosupport.c
1113+ src/detection/dns/dns_linux.c
1114+ src/detection/physicaldisk/physicaldisk_nosupport.c
1115+ src/detection/physicalmemory/physicalmemory_nosupport.c
1116+ src/detection/diskio/diskio_nosupport.c
1117+ src/detection/displayserver/displayserver_haiku.cpp
1118+ src/detection/font/font_haiku.cpp
1119+ src/detection/gpu/gpu_nosupport.c
1120+ src/detection/gpu/gpu_pci.c
1121+ src/detection/gtk_qt/gtk.c
1122+ src/detection/host/host_nosupport.c
1123+ src/detection/icons/icons_nosupport.c
1124+ src/detection/initsystem/initsystem_nosupport.c
1125+ src/detection/keyboard/keyboard_nosupport.c
1126+ src/detection/libc/libc_nosupport.c
1127+ src/detection/lm/lm_nosupport.c
1128+ src/detection/loadavg/loadavg_nosupport.c
1129+ src/detection/locale/locale_linux.c
1130+ src/detection/localip/localip_linux.c
1131+ src/detection/gamepad/gamepad_nosupport.c
1132+ src/detection/media/media_nosupport.c
1133+ src/detection/memory/memory_haiku.c
1134+ src/detection/mouse/mouse_nosupport.c
1135+ src/detection/netio/netio_nosupport.c
1136+ src/detection/opengl/opengl_linux.c
1137+ src/detection/os/os_haiku.c
1138+ src/detection/packages/packages_haiku.c
1139+ src/detection/poweradapter/poweradapter_nosupport.c
1140+ src/detection/processes/processes_haiku.c
1141+ src/detection/gtk_qt/qt.c
1142+ src/detection/sound/sound_nosupport.c
1143+ src/detection/swap/swap_haiku.c
1144+ src/detection/terminalfont/terminalfont_linux.c
1145+ src/detection/terminalshell/terminalshell_linux.c
1146+ src/detection/terminalsize/terminalsize_linux.c
1147+ src/detection/theme/theme_nosupport.c
1148+ src/detection/tpm/tpm_nosupport.c
1149+ src/detection/uptime/uptime_haiku.c
1150+ src/detection/users/users_linux.c
1151+ src/detection/wallpaper/wallpaper_nosupport.c
1152+ src/detection/wifi/wifi_nosupport.c
1153+ src/detection/wm/wm_nosupport.c
1154+ src/detection/de/de_nosupport.c
1155+ src/detection/wmtheme/wmtheme_nosupport.c
1156+ src/detection/camera/camera_nosupport.c
1157+ src/detection/zpool/zpool_nosupport.c
1158+ src/util/platform/FFPlatform_unix.c
1159+ src/util/binary_linux.c
1160+ )
10911161endif ()
10921162
10931163if (ENABLE_DIRECTX_HEADERS)
@@ -1112,6 +1182,9 @@ endif()
11121182if (LINUX)
11131183 check_function_exists(statx HAVE_STATX)
11141184endif ()
1185+ if (NOT WIN32 )
1186+ check_function_exists(pipe2 HAVE_PIPE2)
1187+ endif ()
11151188
11161189if (ENABLE_SYSTEM_YYJSON)
11171190 find_package (yyjson)
@@ -1226,6 +1299,10 @@ if(HAVE_WCWIDTH)
12261299 target_compile_definitions (libfastfetch PUBLIC FF_HAVE_WCWIDTH)
12271300endif ()
12281301
1302+ if (HAVE_PIPE2)
1303+ target_compile_definitions (libfastfetch PUBLIC FF_HAVE_PIPE2)
1304+ endif ()
1305+
12291306if (NOT "${CUSTOM_PCI_IDS_PATH} " STREQUAL "" )
12301307 message (STATUS "Custom file path of pci.ids: ${CUSTOM_PCI_IDS_PATH} " )
12311308 target_compile_definitions (libfastfetch PRIVATE FF_CUSTOM_PCI_IDS_PATH=${CUSTOM_PCI_IDS_PATH} )
@@ -1534,6 +1611,12 @@ elseif(ANDROID)
15341611 )
15351612 endif ()
15361613 endif ()
1614+ elseif (Haiku)
1615+ target_link_libraries (libfastfetch
1616+ PRIVATE "network"
1617+ PRIVATE "be"
1618+ PRIVATE "gnu"
1619+ )
15371620endif ()
15381621
15391622target_include_directories (libfastfetch
0 commit comments