11cmake_minimum_required (VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
22
33project (fastfetch
4- VERSION 2.1.0
4+ VERSION 2.1.1
55 LANGUAGES C
66 DESCRIPTION "Fast system information tool"
77 HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
@@ -222,6 +222,9 @@ fastfetch_load_text(src/data/help_config.txt DATATEXT_HELP_CONFIG)
222222
223223configure_file (src/fastfetch_config.h.in fastfetch_config.h @ONLY)
224224configure_file (src/fastfetch_datatext.h.in fastfetch_datatext.h @ONLY)
225+ if (APPLE )
226+ configure_file (src/util/apple /Info.plist.in Info.plist @ONLY)
227+ endif ()
225228
226229####################
227230# Ascii image data #
@@ -273,6 +276,7 @@ set(LIBFASTFETCH_SRC
273276 src/detection/cpu/cpu.c
274277 src/detection/cpuusage/cpuusage.c
275278 src/detection/disk/disk.c
279+ src/detection/diskio/diskio.c
276280 src/detection/displayserver/displayserver.c
277281 src/detection/font/font.c
278282 src/detection/gpu/gpu.c
@@ -310,6 +314,7 @@ set(LIBFASTFETCH_SRC
310314 src/modules/datetime/datetime.c
311315 src/modules/de/de.c
312316 src/modules/disk/disk.c
317+ src/modules/diskio/diskio.c
313318 src/modules/font/font.c
314319 src/modules/gpu/gpu.c
315320 src/modules/host/host.c
@@ -375,6 +380,7 @@ if(LINUX)
375380 src/detection/cursor/cursor_linux.c
376381 src/detection/bluetooth/bluetooth_linux.c
377382 src/detection/disk/disk_linux.c
383+ src/detection/diskio/diskio_linux.c
378384 src/detection/displayserver/linux/displayserver_linux.c
379385 src/detection/displayserver/linux/wayland.c
380386 src/detection/displayserver/linux/wmde.c
@@ -385,6 +391,7 @@ if(LINUX)
385391 src/detection/gtk_qt/gtk.c
386392 src/detection/host/host_linux.c
387393 src/detection/icons/icons_linux.c
394+ src/detection/libc/libc_linux.c
388395 src/detection/lm/lm_linux.c
389396 src/detection/localip/localip_linux.c
390397 src/detection/gamepad/gamepad_linux.c
@@ -428,11 +435,13 @@ elseif(ANDROID)
428435 src/detection/cursor/cursor_nosupport.c
429436 src/detection/cpuusage/cpuusage_linux.c
430437 src/detection/disk/disk_linux.c
438+ src/detection/diskio/diskio_linux.c
431439 src/detection/displayserver/displayserver_android.c
432440 src/detection/font/font_nosupport.c
433441 src/detection/gpu/gpu_nosupport.c
434442 src/detection/host/host_android.c
435443 src/detection/icons/icons_nosupport.c
444+ src/detection/libc/libc_android.c
436445 src/detection/lm/lm_nosupport.c
437446 src/detection/localip/localip_linux.c
438447 src/detection/gamepad/gamepad_nosupport.c
@@ -477,6 +486,7 @@ elseif(BSD)
477486 src/detection/cpuusage/cpuusage_bsd.c
478487 src/detection/cursor/cursor_linux.c
479488 src/detection/disk/disk_bsd.c
489+ src/detection/diskio/diskio_bsd.c
480490 src/detection/displayserver/linux/displayserver_linux.c
481491 src/detection/displayserver/linux/wayland.c
482492 src/detection/displayserver/linux/wmde.c
@@ -488,6 +498,7 @@ elseif(BSD)
488498 src/detection/host/host_bsd.c
489499 src/detection/lm/lm_linux.c
490500 src/detection/icons/icons_linux.c
501+ src/detection/libc/libc_bsd.c
491502 src/detection/localip/localip_linux.c
492503 src/detection/gamepad/gamepad_bsd.c
493504 src/detection/media/media_linux.c
@@ -531,12 +542,14 @@ elseif(APPLE)
531542 src/detection/cpuusage/cpuusage_apple.c
532543 src/detection/cursor/cursor_apple.m
533544 src/detection/disk/disk_bsd.c
545+ src/detection/diskio/diskio_apple.c
534546 src/detection/displayserver/displayserver_apple.c
535547 src/detection/font/font_apple.m
536548 src/detection/gpu/gpu_apple.c
537549 src/detection/host/host_apple .c
538550 src/detection/lm/lm_nosupport.c
539551 src/detection/icons/icons_nosupport.c
552+ src/detection/libc/libc_apple.c
540553 src/detection/localip/localip_linux.c
541554 src/detection/gamepad/gamepad_apple.c
542555 src/detection/media/media_apple.m
@@ -580,11 +593,13 @@ elseif(WIN32)
580593 src/detection/cpuusage/cpuusage_windows.c
581594 src/detection/cursor/cursor_windows.c
582595 src/detection/disk/disk_windows.c
596+ src/detection/diskio/diskio_windows.c
583597 src/detection/displayserver/displayserver_windows.c
584598 src/detection/font/font_windows.c
585599 src/detection/gpu/gpu_windows.c
586600 src/detection/host/host_windows.c
587601 src/detection/icons/icons_windows.c
602+ src/detection/libc/libc_windows.cpp
588603 src/detection/lm/lm_nosupport.c
589604 src/detection/localip/localip_windows.c
590605 src/detection/gamepad/gamepad_windows.c
@@ -651,6 +666,28 @@ if(yyjson_FOUND)
651666 target_link_libraries (libfastfetch PRIVATE yyjson)
652667endif ()
653668
669+ if (LINUX AND EXISTS "/lib/ld-musl-${CMAKE_HOST_SYSTEM_PROCESSOR} .so.1" )
670+ execute_process (COMMAND "/lib/ld-musl-${CMAKE_HOST_SYSTEM_PROCESSOR} .so.1"
671+ ERROR_VARIABLE LD_MUSL_RESULT)
672+ if ("${LD_MUSL_RESULT} " MATCHES "Version ([0-9]+\\ .[0-9]+\\ .[0-9]+)" )
673+ target_compile_definitions (libfastfetch PUBLIC FF_MUSL_VERSION="${CMAKE_MATCH_1} " )
674+ endif ()
675+ endif ()
676+ if (APPLE AND EXISTS "/usr/bin/otool" )
677+ execute_process (COMMAND /usr/bin/otool -L /usr/bin/otool
678+ OUTPUT_VARIABLE OTOOL_OTOOL_RESULT)
679+ if ("${OTOOL_OTOOL_RESULT} " MATCHES "libSystem\\ .B\\ .dylib \\ (.*current version ([0-9]+\\ .[0-9]+\\ .[0-9]+)\\ )" )
680+ target_compile_definitions (libfastfetch PUBLIC FF_LIBSYSTEM_VERSION="${CMAKE_MATCH_1} " )
681+ endif ()
682+ endif ()
683+ if (BSD AND EXISTS "/usr/local/bin/objdump" )
684+ execute_process (COMMAND /bin/sh -c "/usr/local/bin/objdump -T /lib/libc.so.* | grep 'FBSD_[^ )]*' -o | sort -Vru | head -1"
685+ OUTPUT_VARIABLE OBJDUMP_T_RESULT)
686+ if ("${OBJDUMP_T_RESULT} " MATCHES "FBSD_([0-9]+\\ .[0-9]+)" )
687+ target_compile_definitions (libfastfetch PUBLIC FF_FBSD_VERSION="${CMAKE_MATCH_1} " )
688+ endif ()
689+ endif ()
690+
654691target_compile_definitions (libfastfetch PUBLIC _GNU_SOURCE _XOPEN_SOURCE __STDC_WANT_LIB_EXT1__=1)
655692if (WIN32 )
656693 target_compile_definitions (libfastfetch PUBLIC WIN32_LEAN_AND_MEAN=1)
@@ -856,6 +893,7 @@ elseif(BSD)
856893 target_link_libraries (libfastfetch
857894 PRIVATE "m"
858895 PRIVATE "usbhid"
896+ PRIVATE "devstat"
859897 )
860898elseif (ANDROID)
861899 CHECK_LIBRARY_EXISTS(-l:libandroid-wordexp.a wordexp "" HAVE_LIBANDROID_WORDEXP_STATIC)
@@ -922,6 +960,13 @@ if(WIN32)
922960 target_sources (flashfetch
923961 PRIVATE src/util/windows/version .rc
924962 )
963+ elseif (APPLE )
964+ target_link_options (fastfetch
965+ PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,Info.plist
966+ )
967+ target_link_options (flashfetch
968+ PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,Info.plist
969+ )
925970endif ()
926971
927972###################
0 commit comments