11cmake_minimum_required (VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
22
33project (fastfetch
4- VERSION 2.35 .0
4+ VERSION 2.36 .0
55 LANGUAGES C
66 DESCRIPTION "Fast neofetch-like system information tool"
77 HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
@@ -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 ()
@@ -70,12 +72,12 @@ cmake_dependent_option(ENABLE_IMAGEMAGICK7 "Enable imagemagick 7" ON "LINUX OR F
7072cmake_dependent_option(ENABLE_IMAGEMAGICK6 "Enable imagemagick 6" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR APPLE OR SunOS" OFF )
7173cmake_dependent_option(ENABLE_CHAFA "Enable chafa" ON "ENABLE_IMAGEMAGICK6 OR ENABLE_IMAGEMAGICK7" OFF )
7274cmake_dependent_option(ENABLE_ZLIB "Enable zlib" ON "ENABLE_IMAGEMAGICK6 OR ENABLE_IMAGEMAGICK7" OFF )
73- cmake_dependent_option(ENABLE_EGL "Enable egl" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR WIN32 OR SunOS" OFF )
74- cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR SunOS" OFF )
75+ cmake_dependent_option(ENABLE_EGL "Enable egl" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR WIN32 OR SunOS OR Haiku " OFF )
76+ cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR SunOS OR Haiku " OFF )
7577cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF )
7678cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR WIN32 OR ANDROID OR SunOS" OFF )
7779cmake_dependent_option(ENABLE_FREETYPE "Enable freetype" ON "ANDROID" OFF )
78- cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX OR OpenBSD OR NetBSD OR SunOS" OFF )
80+ cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX OR SunOS" OFF )
7981cmake_dependent_option(ENABLE_DDCUTIL "Enable ddcutil" ON "LINUX" OFF )
8082cmake_dependent_option(ENABLE_DIRECTX_HEADERS "Enable DirectX headers for WSL" ON "LINUX" OFF )
8183cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX OR ANDROID OR DragonFly" OFF )
@@ -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} " )
@@ -761,7 +763,7 @@ elseif(NetBSD)
761763 src/detection/poweradapter/poweradapter_nosupport.c
762764 src/detection/processes/processes_nbsd.c
763765 src/detection/gtk_qt/qt.c
764- src/detection/sound/sound_linux .c
766+ src/detection/sound/sound_nbsd .c
765767 src/detection/swap/swap_obsd.c
766768 src/detection/terminalfont/terminalfont_linux.c
767769 src/detection/terminalshell/terminalshell_linux.c
@@ -843,7 +845,7 @@ elseif(OpenBSD)
843845 src/detection/poweradapter/poweradapter_nosupport.c
844846 src/detection/processes/processes_obsd.c
845847 src/detection/gtk_qt/qt.c
846- src/detection/sound/sound_linux .c
848+ src/detection/sound/sound_obsd .c
847849 src/detection/swap/swap_obsd.c
848850 src/detection/terminalfont/terminalfont_linux.c
849851 src/detection/terminalshell/terminalshell_linux.c
@@ -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} )
@@ -1504,6 +1581,7 @@ elseif(OpenBSD)
15041581 target_link_libraries (libfastfetch
15051582 PRIVATE "m"
15061583 PRIVATE "kvm"
1584+ PRIVATE "sndio"
15071585 )
15081586elseif (NetBSD)
15091587 target_link_libraries (libfastfetch
@@ -1533,6 +1611,12 @@ elseif(ANDROID)
15331611 )
15341612 endif ()
15351613 endif ()
1614+ elseif (Haiku)
1615+ target_link_libraries (libfastfetch
1616+ PRIVATE "network"
1617+ PRIVATE "be"
1618+ PRIVATE "gnu"
1619+ )
15361620endif ()
15371621
15381622target_include_directories (libfastfetch
0 commit comments