diff --git a/CMakeLists.txt b/CMakeLists.txt index 198283de0..d5a3042b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,7 @@ cmake_dependent_option(ENABLE_FREETYPE "Enable freetype" ON "ANDROID" OFF) cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX OR SunOS" OFF) cmake_dependent_option(ENABLE_DDCUTIL "Enable ddcutil" ON "LINUX" OFF) cmake_dependent_option(ENABLE_DIRECTX_HEADERS "Enable DirectX headers for WSL" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX" OFF) +cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX OR FreeBSD OR SunOS" OFF) cmake_dependent_option(ENABLE_THREADS "Enable multithreading" ON "Threads_FOUND" OFF) option(ENABLE_SYSTEM_YYJSON "Use system provided (instead of fastfetch embedded) yyjson library" OFF) @@ -621,6 +621,7 @@ elseif(FreeBSD) src/detection/wmtheme/wmtheme_linux.c src/detection/camera/camera_linux.c src/util/platform/FFPlatform_unix.c + src/util/linux/elf.c ) elseif(APPLE) list(APPEND LIBFASTFETCH_SRC @@ -828,6 +829,7 @@ elseif(SunOS) src/detection/wmtheme/wmtheme_linux.c src/detection/camera/camera_nosupport.c src/util/platform/FFPlatform_unix.c + src/util/linux/elf.c ) endif() diff --git a/src/util/linux/elf.c b/src/util/linux/elf.c index 4d210cc4b..4e65c15db 100644 --- a/src/util/linux/elf.c +++ b/src/util/linux/elf.c @@ -38,7 +38,6 @@ const char* ffElfExtractStrings(const char* elfFile, bool (*cb)(const char* str, } Elf_Scn* scn = NULL; - FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate(); while ((scn = ffelf_nextscn(elf, scn)) != NULL) { Elf64_Shdr* shdr64 = ffelf64_getshdr(scn);