@@ -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
@@ -1611,41 +1612,52 @@ target_link_libraries(fastfetch
1611
1612
PRIVATE libfastfetch
1612
1613
)
1613
1614
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
1615
# Prevent fastfetch from linking to libstdc++
1625
1616
set (CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "" )
1626
1617
set (CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "" )
1627
1618
set_target_properties (fastfetch PROPERTIES LINKER_LANGUAGE C)
1628
- set_target_properties (flashfetch PROPERTIES LINKER_LANGUAGE C)
1629
1619
1630
1620
if (WIN32 )
1631
1621
target_sources (fastfetch
1632
1622
PRIVATE src/util/windows/version .rc
1633
1623
)
1634
- target_sources (flashfetch
1635
- PRIVATE src/util/windows/version .rc
1636
- )
1637
1624
elseif (APPLE )
1638
1625
target_link_options (fastfetch
1639
1626
PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,Info.plist
1640
1627
)
1641
- target_link_options (flashfetch
1642
- PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,Info.plist
1643
- )
1644
1628
endif ()
1645
1629
1646
1630
if (BINARY_LINK_TYPE STREQUAL "static" )
1647
1631
target_link_options (fastfetch PRIVATE "-static" )
1648
- target_link_options (flashfetch PRIVATE "-static" )
1632
+ endif ()
1633
+
1634
+ # Apply all above parameters to flashfetch if it is built
1635
+ if (BUILD_FLASHFETCH)
1636
+ add_executable (flashfetch
1637
+ src/flashfetch.c
1638
+ )
1639
+ target_compile_definitions (flashfetch
1640
+ PRIVATE FASTFETCH_TARGET_BINARY_NAME=flashfetch
1641
+ )
1642
+ target_link_libraries (flashfetch
1643
+ PRIVATE libfastfetch
1644
+ )
1645
+
1646
+ set_target_properties (flashfetch PROPERTIES LINKER_LANGUAGE C)
1647
+
1648
+ if (WIN32 )
1649
+ target_sources (flashfetch
1650
+ PRIVATE src/util/windows/version .rc
1651
+ )
1652
+ elseif (APPLE )
1653
+ target_link_options (flashfetch
1654
+ PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,Info.plist
1655
+ )
1656
+ endif ()
1657
+
1658
+ if (BINARY_LINK_TYPE STREQUAL "static" )
1659
+ target_link_options (flashfetch PRIVATE "-static" )
1660
+ endif ()
1649
1661
endif ()
1650
1662
1651
1663
###################
@@ -1687,10 +1699,17 @@ endif()
1687
1699
include (GNUInstallDirs)
1688
1700
1689
1701
install (
1690
- TARGETS fastfetch flashfetch
1702
+ TARGETS fastfetch
1691
1703
DESTINATION "${CMAKE_INSTALL_BINDIR} "
1692
1704
)
1693
1705
1706
+ if (TARGET flashfetch)
1707
+ install (
1708
+ TARGETS flashfetch
1709
+ DESTINATION "${CMAKE_INSTALL_BINDIR} "
1710
+ )
1711
+ endif ()
1712
+
1694
1713
if (TARGET ffwinrt)
1695
1714
install (
1696
1715
TARGETS ffwinrt
0 commit comments