mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Libc (macOS): detect libSystem version
This commit is contained in:
+8
-1
@@ -546,7 +546,7 @@ elseif(APPLE)
|
||||
src/detection/host/host_apple.c
|
||||
src/detection/lm/lm_nosupport.c
|
||||
src/detection/icons/icons_nosupport.c
|
||||
src/detection/libc/libc_nosupport.c
|
||||
src/detection/libc/libc_apple.c
|
||||
src/detection/localip/localip_linux.c
|
||||
src/detection/gamepad/gamepad_apple.c
|
||||
src/detection/media/media_apple.m
|
||||
@@ -670,6 +670,13 @@ if(LINUX AND EXISTS "/lib/ld-musl-${CMAKE_HOST_SYSTEM_PROCESSOR}.so.1")
|
||||
target_compile_definitions(libfastfetch PUBLIC FF_MUSL_VERSION="${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endif()
|
||||
if(APPLE AND EXISTS "/usr/bin/otool")
|
||||
execute_process(COMMAND /usr/bin/otool -L /usr/bin/otool
|
||||
OUTPUT_VARIABLE OTOOL_OTOOL_RESULT)
|
||||
if("${OTOOL_OTOOL_RESULT}" MATCHES "libSystem\\.B\\.dylib \\(.*current version ([0-9]+\\.[0-9]+\\.[0-9]+)\\)")
|
||||
target_compile_definitions(libfastfetch PUBLIC FF_LIBSYSTEM_VERSION="${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE _XOPEN_SOURCE __STDC_WANT_LIB_EXT1__=1)
|
||||
if(WIN32)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "libc.h"
|
||||
|
||||
const char* ffDetectLibc(FFLibcResult* result)
|
||||
{
|
||||
result->name = "libSystem";
|
||||
|
||||
#ifdef FF_LIBSYSTEM_VERSION
|
||||
result->version = FF_LIBSYSTEM_VERSION;
|
||||
#else
|
||||
result->version = NULL;
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user