File tree Expand file tree Collapse file tree 3 files changed +25
-7
lines changed Expand file tree Collapse file tree 3 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -630,11 +630,6 @@ if(WIN32)
630630 target_compile_definitions (libfastfetch PUBLIC WIN32_LEAN_AND_MEAN=1)
631631endif ()
632632
633- CHECK_INCLUDE_FILE("utmpx.h" HAVE_UTMPX_H)
634- if (HAVE_UTMPX_H)
635- target_compile_definitions (libfastfetch PRIVATE FF_HAVE_UTMPX_H)
636- endif ()
637-
638633if (HAVE_WCWIDTH)
639634 target_compile_definitions (libfastfetch PRIVATE FF_HAVE_WCWIDTH)
640635endif ()
@@ -829,6 +824,20 @@ elseif(BSD)
829824 target_link_libraries (libfastfetch
830825 PRIVATE "usbhid"
831826 )
827+ elseif (ANDROID)
828+ CHECK_LIBRARY_EXISTS(-l:libandroid-wordexp.a wordexp "" HAVE_LIBANDROID_WORDEXP_STATIC)
829+ if (HAVE_LIBANDROID_WORDEXP_STATIC)
830+ target_link_libraries (libfastfetch
831+ PRIVATE -l:libandroid-wordexp.a
832+ )
833+ else ()
834+ CHECK_LIBRARY_EXISTS(android-wordexp wordexp "" HAVE_LIBANDROID_WORDEXP)
835+ if (HAVE_LIBANDROID_WORDEXP)
836+ target_link_libraries (libfastfetch
837+ PRIVATE android-wordexp
838+ )
839+ endif ()
840+ endif ()
832841endif ()
833842
834843target_include_directories (libfastfetch
Original file line number Diff line number Diff line change 11#include "io.h"
22#include "util/stringUtils.h"
3+ #include "util/unused.h"
34
45#include <fcntl.h>
56#include <sys/stat.h>
67#include <termios.h>
78#include <poll.h>
89#include <dirent.h>
10+
11+ #if __has_include (< wordexp .h > )
912#include <wordexp.h>
13+ #endif
1014
1115static void createSubfolders (const char * fileName )
1216{
@@ -108,9 +112,12 @@ bool ffPathExists(const char* path, FFPathType type)
108112 return false;
109113}
110114
111- bool ffPathExpandEnv (const char * in , FFstrbuf * out )
115+ bool ffPathExpandEnv (FF_MAYBE_UNUSED const char * in , FF_MAYBE_UNUSED FFstrbuf * out )
112116{
113117 bool result = false;
118+
119+ #if __has_include (< wordexp .h > ) // https://github.com/termux/termux-packages/pull/7056
120+
114121 wordexp_t exp ;
115122 if (wordexp (in , & exp , WRDE_NOCMD ) != 0 )
116123 return false;
@@ -123,6 +130,8 @@ bool ffPathExpandEnv(const char* in, FFstrbuf* out)
123130
124131 wordfree (& exp );
125132
133+ #endif
134+
126135 return result ;
127136}
128137
Original file line number Diff line number Diff line change 11#include "fastfetch.h"
22#include "users.h"
33
4- #if FF_HAVE_UTMPX_H
4+ #if __has_include ( < utmpx . h > )
55 #include <utmpx.h>
66#else
77 //for Android compatibility
You can’t perform that action at this time.
0 commit comments