|
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.32.1 |
| 4 | + VERSION 2.33.0 |
5 | 5 | LANGUAGES C
|
6 | 6 | DESCRIPTION "Fast neofetch-like system information tool"
|
7 | 7 | HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
|
@@ -86,6 +86,7 @@ cmake_dependent_option(ENABLE_PCIACCESS "Enable libpciaccess" ON "NetBSD OR Open
|
86 | 86 | option(ENABLE_SYSTEM_YYJSON "Use system provided (instead of fastfetch embedded) yyjson library" OFF)
|
87 | 87 | option(ENABLE_ASAN "Build fastfetch with ASAN (address sanitizer)" OFF)
|
88 | 88 | option(ENABLE_LTO "Enable link-time optimization in release mode if supported" ON)
|
| 89 | +option(BUILD_FLASHFETCH "Build flashfetch" ON) # Also build the flashfetch binary |
89 | 90 | option(BUILD_TESTS "Build tests" OFF) # Also create test executables
|
90 | 91 | option(SET_TWEAK "Add tweak to project version" ON) # This is set to off by github actions for release builds
|
91 | 92 | option(IS_MUSL "Build with musl libc" OFF) # Used by Github Actions
|
@@ -616,8 +617,8 @@ elseif(FreeBSD)
|
616 | 617 | src/common/sysctl.c
|
617 | 618 | src/detection/battery/battery_bsd.c
|
618 | 619 | src/detection/bios/bios_bsd.c
|
619 |
| - src/detection/bluetooth/bluetooth_linux.c |
620 |
| - src/detection/bluetoothradio/bluetoothradio_linux.c |
| 620 | + src/detection/bluetooth/bluetooth_nosupport.c |
| 621 | + src/detection/bluetoothradio/bluetoothradio_nosupport.c |
621 | 622 | src/detection/board/board_bsd.c
|
622 | 623 | src/detection/bootmgr/bootmgr_bsd.c
|
623 | 624 | src/detection/brightness/brightness_bsd.c
|
@@ -697,13 +698,13 @@ elseif(NetBSD)
|
697 | 698 | src/common/networking_linux.c
|
698 | 699 | src/common/processing_linux.c
|
699 | 700 | src/common/sysctl.c
|
700 |
| - src/detection/battery/battery_nosupport.c |
| 701 | + src/detection/battery/battery_nbsd.c |
701 | 702 | src/detection/bios/bios_nbsd.c
|
702 |
| - src/detection/bluetooth/bluetooth_linux.c |
703 |
| - src/detection/bluetoothradio/bluetoothradio_linux.c |
| 703 | + src/detection/bluetooth/bluetooth_nosupport.c |
| 704 | + src/detection/bluetoothradio/bluetoothradio_nosupport.c |
704 | 705 | src/detection/board/board_nbsd.c
|
705 | 706 | src/detection/bootmgr/bootmgr_nosupport.c
|
706 |
| - src/detection/brightness/brightness_nosupport.c |
| 707 | + src/detection/brightness/brightness_nbsd.c |
707 | 708 | src/detection/btrfs/btrfs_nosupport.c
|
708 | 709 | src/detection/chassis/chassis_nbsd.c
|
709 | 710 | src/detection/cpu/cpu_nbsd.c
|
@@ -779,13 +780,13 @@ elseif(OpenBSD)
|
779 | 780 | src/common/networking_linux.c
|
780 | 781 | src/common/processing_linux.c
|
781 | 782 | src/common/sysctl.c
|
782 |
| - src/detection/battery/battery_nosupport.c |
| 783 | + src/detection/battery/battery_obsd.c |
783 | 784 | src/detection/bios/bios_nosupport.c
|
784 |
| - src/detection/bluetooth/bluetooth_linux.c |
785 |
| - src/detection/bluetoothradio/bluetoothradio_linux.c |
| 785 | + src/detection/bluetooth/bluetooth_nosupport.c |
| 786 | + src/detection/bluetoothradio/bluetoothradio_nosupport.c |
786 | 787 | src/detection/board/board_nosupport.c
|
787 | 788 | src/detection/bootmgr/bootmgr_nosupport.c
|
788 |
| - src/detection/brightness/brightness_nosupport.c |
| 789 | + src/detection/brightness/brightness_obsd.c |
789 | 790 | src/detection/btrfs/btrfs_nosupport.c
|
790 | 791 | src/detection/chassis/chassis_nosupport.c
|
791 | 792 | src/detection/cpu/cpu_obsd.c
|
@@ -1485,6 +1486,7 @@ elseif(OpenBSD)
|
1485 | 1486 | elseif(NetBSD)
|
1486 | 1487 | target_link_libraries(libfastfetch
|
1487 | 1488 | PRIVATE "m"
|
| 1489 | + PRIVATE "prop" |
1488 | 1490 | )
|
1489 | 1491 | elseif(SunOS)
|
1490 | 1492 | target_link_libraries(libfastfetch
|
@@ -1611,41 +1613,52 @@ target_link_libraries(fastfetch
|
1611 | 1613 | PRIVATE libfastfetch
|
1612 | 1614 | )
|
1613 | 1615 |
|
1614 |
| -add_executable(flashfetch |
1615 |
| - src/flashfetch.c |
1616 |
| -) |
1617 |
| -target_compile_definitions(flashfetch |
1618 |
| - PRIVATE FASTFETCH_TARGET_BINARY_NAME=flashfetch |
1619 |
| -) |
1620 |
| -target_link_libraries(flashfetch |
1621 |
| - PRIVATE libfastfetch |
1622 |
| -) |
1623 |
| - |
1624 | 1616 | # Prevent fastfetch from linking to libstdc++
|
1625 | 1617 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
|
1626 | 1618 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "")
|
1627 | 1619 | set_target_properties(fastfetch PROPERTIES LINKER_LANGUAGE C)
|
1628 |
| -set_target_properties(flashfetch PROPERTIES LINKER_LANGUAGE C) |
1629 | 1620 |
|
1630 | 1621 | if(WIN32)
|
1631 | 1622 | target_sources(fastfetch
|
1632 | 1623 | PRIVATE src/util/windows/version.rc
|
1633 | 1624 | )
|
1634 |
| - target_sources(flashfetch |
1635 |
| - PRIVATE src/util/windows/version.rc |
1636 |
| - ) |
1637 | 1625 | elseif(APPLE)
|
1638 | 1626 | target_link_options(fastfetch
|
1639 | 1627 | PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,Info.plist
|
1640 | 1628 | )
|
1641 |
| - target_link_options(flashfetch |
1642 |
| - PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,Info.plist |
1643 |
| - ) |
1644 | 1629 | endif()
|
1645 | 1630 |
|
1646 | 1631 | if(BINARY_LINK_TYPE STREQUAL "static")
|
1647 | 1632 | target_link_options(fastfetch PRIVATE "-static")
|
1648 |
| - target_link_options(flashfetch PRIVATE "-static") |
| 1633 | +endif() |
| 1634 | + |
| 1635 | +# Apply all above parameters to flashfetch if it is built |
| 1636 | +if (BUILD_FLASHFETCH) |
| 1637 | + add_executable(flashfetch |
| 1638 | + src/flashfetch.c |
| 1639 | + ) |
| 1640 | + target_compile_definitions(flashfetch |
| 1641 | + PRIVATE FASTFETCH_TARGET_BINARY_NAME=flashfetch |
| 1642 | + ) |
| 1643 | + target_link_libraries(flashfetch |
| 1644 | + PRIVATE libfastfetch |
| 1645 | + ) |
| 1646 | + |
| 1647 | + set_target_properties(flashfetch PROPERTIES LINKER_LANGUAGE C) |
| 1648 | + |
| 1649 | + if(WIN32) |
| 1650 | + target_sources(flashfetch |
| 1651 | + PRIVATE src/util/windows/version.rc |
| 1652 | + ) |
| 1653 | + elseif(APPLE) |
| 1654 | + target_link_options(flashfetch |
| 1655 | + PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,Info.plist |
| 1656 | + ) |
| 1657 | + endif() |
| 1658 | + |
| 1659 | + if(BINARY_LINK_TYPE STREQUAL "static") |
| 1660 | + target_link_options(flashfetch PRIVATE "-static") |
| 1661 | + endif() |
1649 | 1662 | endif()
|
1650 | 1663 |
|
1651 | 1664 | ###################
|
@@ -1687,10 +1700,17 @@ endif()
|
1687 | 1700 | include(GNUInstallDirs)
|
1688 | 1701 |
|
1689 | 1702 | install(
|
1690 |
| - TARGETS fastfetch flashfetch |
| 1703 | + TARGETS fastfetch |
1691 | 1704 | DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
1692 | 1705 | )
|
1693 | 1706 |
|
| 1707 | +if (TARGET flashfetch) |
| 1708 | + install( |
| 1709 | + TARGETS flashfetch |
| 1710 | + DESTINATION "${CMAKE_INSTALL_BINDIR}" |
| 1711 | + ) |
| 1712 | +endif() |
| 1713 | + |
1694 | 1714 | if (TARGET ffwinrt)
|
1695 | 1715 | install(
|
1696 | 1716 | TARGETS ffwinrt
|
|
0 commit comments