|
1 | 1 | cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url |
2 | 2 |
|
3 | 3 | project(fastfetch |
4 | | - VERSION 2.24.0 |
| 4 | + VERSION 2.25.0 |
5 | 5 | LANGUAGES C |
6 | 6 | DESCRIPTION "Fast neofetch-like system information tool" |
7 | 7 | HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch" |
@@ -88,6 +88,15 @@ if(NOT BINARY_LINK_TYPE IN_LIST BINARY_LINK_TYPE_OPTIONS) |
88 | 88 | message(FATAL_ERROR "BINARY_LINK_TYPE must be one of ${BINARY_LINK_TYPE_OPTIONS}") |
89 | 89 | endif() |
90 | 90 |
|
| 91 | +set(PACKAGE_MANAGERS AM APK BREW CHOCO DPKG EMERGE EOPKG FLATPAK GUIX LINGLONG LPKG LPKGBUILD MACPORTS NIX OPKG PACMAN PALUDIS PKG PKGTOOL RPM SCOOP SNAP SORCERY WINGET XBPS) |
| 92 | +foreach(package_manager ${PACKAGE_MANAGERS}) |
| 93 | + if(package_manager STREQUAL "WINGET") |
| 94 | + option(PACKAGES_DISABLE_${package_manager} "Disable ${package_manager} package manager detection by default" ON) |
| 95 | + else() |
| 96 | + option(PACKAGES_DISABLE_${package_manager} "Disable ${package_manager} package manager detection by default" OFF) |
| 97 | + endif() |
| 98 | +endforeach() |
| 99 | + |
91 | 100 | if (LINUX) |
92 | 101 | set(CUSTOM_PCI_IDS_PATH "" CACHE STRING "Custom path to file pci.ids, defaults to `/usr/share/hwdata/pci.ids`") |
93 | 102 | set(CUSTOM_AMDGPU_IDS_PATH "" CACHE STRING "Custom path to file amdgpu.ids, defaults to `/usr/share/libdrm/amdgpu.ids`") |
@@ -333,6 +342,7 @@ set(LIBFASTFETCH_SRC |
333 | 342 | src/modules/bootmgr/bootmgr.c |
334 | 343 | src/modules/brightness/brightness.c |
335 | 344 | src/modules/break/break.c |
| 345 | + src/modules/btrfs/btrfs.c |
336 | 346 | src/modules/camera/camera.c |
337 | 347 | src/modules/chassis/chassis.c |
338 | 348 | src/modules/colors/colors.c |
@@ -419,6 +429,7 @@ if(LINUX) |
419 | 429 | src/detection/board/board_linux.c |
420 | 430 | src/detection/bootmgr/bootmgr_linux.c |
421 | 431 | src/detection/brightness/brightness_linux.c |
| 432 | + src/detection/btrfs/btrfs_linux.c |
422 | 433 | src/detection/chassis/chassis_linux.c |
423 | 434 | src/detection/cpu/cpu_linux.c |
424 | 435 | src/detection/cpucache/cpucache_linux.c |
@@ -499,6 +510,7 @@ elseif(ANDROID) |
499 | 510 | src/detection/board/board_android.c |
500 | 511 | src/detection/bootmgr/bootmgr_nosupport.c |
501 | 512 | src/detection/brightness/brightness_nosupport.c |
| 513 | + src/detection/btrfs/btrfs_nosupport.c |
502 | 514 | src/detection/chassis/chassis_nosupport.c |
503 | 515 | src/detection/cpu/cpu_linux.c |
504 | 516 | src/detection/cpucache/cpucache_linux.c |
@@ -564,6 +576,7 @@ elseif(FreeBSD) |
564 | 576 | src/detection/board/board_bsd.c |
565 | 577 | src/detection/bootmgr/bootmgr_bsd.c |
566 | 578 | src/detection/brightness/brightness_bsd.c |
| 579 | + src/detection/btrfs/btrfs_nosupport.c |
567 | 580 | src/detection/chassis/chassis_bsd.c |
568 | 581 | src/detection/cpu/cpu_bsd.c |
569 | 582 | src/detection/cpucache/cpucache_shared.c |
@@ -643,6 +656,7 @@ elseif(APPLE) |
643 | 656 | src/detection/board/board_apple.c |
644 | 657 | src/detection/bootmgr/bootmgr_apple.c |
645 | 658 | src/detection/brightness/brightness_apple.c |
| 659 | + src/detection/btrfs/btrfs_nosupport.c |
646 | 660 | src/detection/chassis/chassis_nosupport.c |
647 | 661 | src/detection/cpu/cpu_apple.c |
648 | 662 | src/detection/cpucache/cpucache_apple.c |
@@ -709,6 +723,7 @@ elseif(WIN32) |
709 | 723 | src/detection/board/board_windows.c |
710 | 724 | src/detection/bootmgr/bootmgr_windows.c |
711 | 725 | src/detection/brightness/brightness_windows.cpp |
| 726 | + src/detection/btrfs/btrfs_nosupport.c |
712 | 727 | src/detection/chassis/chassis_windows.c |
713 | 728 | src/detection/cpu/cpu_windows.c |
714 | 729 | src/detection/cpucache/cpucache_windows.c |
@@ -776,6 +791,7 @@ elseif(SunOS) |
776 | 791 | src/detection/board/board_windows.c |
777 | 792 | src/detection/bootmgr/bootmgr_nosupport.c |
778 | 793 | src/detection/brightness/brightness_nosupport.c |
| 794 | + src/detection/btrfs/btrfs_nosupport.c |
779 | 795 | src/detection/chassis/chassis_windows.c |
780 | 796 | src/detection/cpu/cpu_sunos.c |
781 | 797 | src/detection/cpucache/cpucache_shared.c |
@@ -885,8 +901,8 @@ add_library(libfastfetch OBJECT |
885 | 901 | ) |
886 | 902 |
|
887 | 903 | if(yyjson_FOUND) |
888 | | - target_compile_definitions(libfastfetch PRIVATE FF_USE_SYSTEM_YYJSON) |
889 | | - target_link_libraries(libfastfetch PRIVATE yyjson::yyjson) |
| 904 | + target_compile_definitions(libfastfetch PUBLIC FF_USE_SYSTEM_YYJSON) |
| 905 | + target_link_libraries(libfastfetch PUBLIC yyjson::yyjson) |
890 | 906 | # `target_link_libraries(yyjson::yyjson)` sets rpath implicitly |
891 | 907 | else() |
892 | 908 | # Used for dlopen finding dylibs installed by homebrew |
@@ -928,11 +944,11 @@ elseif(SunOS) |
928 | 944 | endif() |
929 | 945 |
|
930 | 946 | if(HAVE_STATX) |
931 | | - target_compile_definitions(libfastfetch PRIVATE FF_HAVE_STATX) |
| 947 | + target_compile_definitions(libfastfetch PUBLIC FF_HAVE_STATX) |
932 | 948 | endif() |
933 | 949 |
|
934 | 950 | if(HAVE_WCWIDTH) |
935 | | - target_compile_definitions(libfastfetch PRIVATE FF_HAVE_WCWIDTH) |
| 951 | + target_compile_definitions(libfastfetch PUBLIC FF_HAVE_WCWIDTH) |
936 | 952 | endif() |
937 | 953 |
|
938 | 954 | if(NOT "${CUSTOM_PCI_IDS_PATH}" STREQUAL "") |
@@ -1264,6 +1280,22 @@ if(NOT WIN32) |
1264 | 1280 | endif() |
1265 | 1281 | endif() |
1266 | 1282 |
|
| 1283 | +set(PACKAGES_DISABLE_LIST "") |
| 1284 | +foreach(package_manager ${PACKAGE_MANAGERS}) |
| 1285 | + if(PACKAGES_DISABLE_${package_manager}) |
| 1286 | + list(APPEND PACKAGES_DISABLE_LIST "${package_manager}") |
| 1287 | + endif() |
| 1288 | +endforeach() |
| 1289 | +if("${PACKAGES_DISABLE_LIST}" STREQUAL "") |
| 1290 | + set(PACKAGES_DISABLE_LIST "FF_PACKAGES_FLAG_NONE") |
| 1291 | +else() |
| 1292 | + message(STATUS "Disabled package managers: ${PACKAGES_DISABLE_LIST}") |
| 1293 | + list(TRANSFORM PACKAGES_DISABLE_LIST PREPEND "FF_PACKAGES_FLAG_") |
| 1294 | + list(TRANSFORM PACKAGES_DISABLE_LIST APPEND "_BIT") |
| 1295 | + list(JOIN PACKAGES_DISABLE_LIST " | " PACKAGES_DISABLE_LIST) |
| 1296 | +endif() |
| 1297 | +target_compile_definitions(libfastfetch PRIVATE FF_PACKAGES_DISABLE_LIST=${PACKAGES_DISABLE_LIST}) |
| 1298 | + |
1267 | 1299 | ###################### |
1268 | 1300 | # Executable targets # |
1269 | 1301 | ###################### |
@@ -1294,13 +1326,6 @@ set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "") |
1294 | 1326 | set_target_properties(fastfetch PROPERTIES LINKER_LANGUAGE C) |
1295 | 1327 | set_target_properties(flashfetch PROPERTIES LINKER_LANGUAGE C) |
1296 | 1328 |
|
1297 | | -if(yyjson_FOUND) |
1298 | | - target_compile_definitions(fastfetch PRIVATE FF_USE_SYSTEM_YYJSON) |
1299 | | - target_link_libraries(fastfetch PRIVATE yyjson::yyjson) |
1300 | | - target_compile_definitions(flashfetch PRIVATE FF_USE_SYSTEM_YYJSON) |
1301 | | - target_link_libraries(flashfetch PRIVATE yyjson::yyjson) |
1302 | | -endif() |
1303 | | - |
1304 | 1329 | if(WIN32) |
1305 | 1330 | target_sources(fastfetch |
1306 | 1331 | PRIVATE src/util/windows/version.rc |
@@ -1347,9 +1372,6 @@ if (BUILD_TESTS) |
1347 | 1372 | target_link_libraries(fastfetch-test-format |
1348 | 1373 | PRIVATE libfastfetch |
1349 | 1374 | ) |
1350 | | - if(yyjson_FOUND) |
1351 | | - target_compile_definitions(fastfetch-test-format PRIVATE FF_USE_SYSTEM_YYJSON) |
1352 | | - endif() |
1353 | 1375 |
|
1354 | 1376 | enable_testing() |
1355 | 1377 | add_test(NAME test-strbuf COMMAND fastfetch-test-strbuf) |
|
0 commit comments