File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -1124,12 +1124,19 @@ if(APPLE AND EXISTS "/usr/bin/otool")
11241124 endif ()
11251125endif ()
11261126if (FreeBSD AND EXISTS "/usr/local/bin/objdump" )
1127- execute_process (COMMAND /bin/sh -c "/usr/local/bin/objdump -T /lib/libc.so.* | grep 'FBSD_[^ ) ]*' -o | sort -Vru | head -1"
1127+ execute_process (COMMAND /bin/sh -c "/usr/local/bin/objdump -T /lib/libc.so.* | grep 'FBSD_[0-9][0-9]* \\ .[0-9][0-9 ]*' -o | sort -Vru | head -1"
11281128 OUTPUT_VARIABLE OBJDUMP_T_RESULT)
11291129 if ("${OBJDUMP_T_RESULT} " MATCHES "FBSD_([0-9]+\\ .[0-9]+)" )
11301130 target_compile_definitions (libfastfetch PUBLIC FF_FBSD_VERSION="${CMAKE_MATCH_1} " )
11311131 endif ()
11321132endif ()
1133+ if (DragonFly AND EXISTS "/usr/local/bin/objdump" )
1134+ execute_process (COMMAND /bin/sh -c "/usr/local/bin/objdump -T /lib/libc.so.* | grep 'DF[0-9][0-9]*\\ .[0-9][0-9]*' -o | sort -Vru | head -1"
1135+ OUTPUT_VARIABLE OBJDUMP_T_RESULT)
1136+ if ("${OBJDUMP_T_RESULT} " MATCHES "DF([0-9]+\\ .[0-9]+)" )
1137+ target_compile_definitions (libfastfetch PUBLIC FF_DF_VERSION="${CMAKE_MATCH_1} " )
1138+ endif ()
1139+ endif ()
11331140
11341141if (LINUX)
11351142 target_compile_definitions (libfastfetch PUBLIC _GNU_SOURCE _XOPEN_SOURCE _ATFILE_SOURCE __STDC_WANT_LIB_EXT1__ _FILE_OFFSET_BITS=64 _TIME_BITS=64) # "$<$<CONFIG:Release>:_FORTIFY_SOURCE=3>"
Original file line number Diff line number Diff line change 22
33const char * ffDetectLibc (FFLibcResult * result )
44{
5+ #ifdef __DragonFly__ // We define `__FreeBSD__` on DragonFly BSD for simplification
6+ result -> name = "DF" ;
7+ #ifdef FF_DF_VERSION
8+ result -> version = FF_DF_VERSION ;
9+ #endif
10+ #elif __FreeBSD__
511 result -> name = "FBSD" ;
6-
7- #ifdef FF_FBSD_VERSION
12+ #ifdef FF_FBSD_VERSION
813 result -> version = FF_FBSD_VERSION ;
14+ #endif
915#else
16+ result -> name = "Unknown" ;
1017 result -> version = NULL ;
1118#endif
1219 return NULL ;
Original file line number Diff line number Diff line change 2626 #define FF_SYSNAME "Android"
2727#elif defined(__linux__ )
2828 #define FF_SYSNAME "Linux"
29+ #elif defined(__DragonFly__ ) // We define `__FreeBSD__` on DragonFly BSD for simplification
30+ #define FF_SYSNAME "DragonFly"
2931#elif defined(__FreeBSD__ )
3032 #define FF_SYSNAME "FreeBSD"
3133#elif defined(__APPLE__ )
You can’t perform that action at this time.
0 commit comments