mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2025-02-20 11:43:27 +08:00
Libc (FreeBSD): detect FBSD version
This commit is contained in:
parent
430da1578d
commit
2d2e0ddc6d
@ -495,7 +495,7 @@ elseif(BSD)
|
||||
src/detection/host/host_bsd.c
|
||||
src/detection/lm/lm_linux.c
|
||||
src/detection/icons/icons_linux.c
|
||||
src/detection/libc/libc_nosupport.c
|
||||
src/detection/libc/libc_bsd.c
|
||||
src/detection/localip/localip_linux.c
|
||||
src/detection/gamepad/gamepad_bsd.c
|
||||
src/detection/media/media_linux.c
|
||||
@ -677,6 +677,13 @@ if(APPLE AND EXISTS "/usr/bin/otool")
|
||||
target_compile_definitions(libfastfetch PUBLIC FF_LIBSYSTEM_VERSION="${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endif()
|
||||
if(BSD AND EXISTS "/usr/local/bin/objdump")
|
||||
execute_process(COMMAND /bin/sh -c "/usr/local/bin/objdump -T /lib/libc.so.* | grep 'FBSD_[^ )]*' -o | sort -Vru | head -1"
|
||||
OUTPUT_VARIABLE OBJDUMP_T_RESULT)
|
||||
if("${OBJDUMP_T_RESULT}" MATCHES "FBSD_([0-9]+\\.[0-9]+)")
|
||||
target_compile_definitions(libfastfetch PUBLIC FF_FBSD_VERSION="${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE _XOPEN_SOURCE __STDC_WANT_LIB_EXT1__=1)
|
||||
if(WIN32)
|
||||
|
13
src/detection/libc/libc_bsd.c
Normal file
13
src/detection/libc/libc_bsd.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "libc.h"
|
||||
|
||||
const char* ffDetectLibc(FFLibcResult* result)
|
||||
{
|
||||
result->name = "FBSD";
|
||||
|
||||
#ifdef FF_FBSD_VERSION
|
||||
result->version = FF_FBSD_VERSION;
|
||||
#else
|
||||
result->version = NULL;
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
#include "libc.h"
|
||||
|
||||
#define FF_STR_INDIR(x) #x
|
||||
#define FF_STR(x) FF_STR_INDIR(x)
|
||||
|
||||
const char* ffDetectLibc(FF_MAYBE_UNUSED FFLibcResult* result)
|
||||
{
|
||||
return "Not supported on this platform";
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user