CMake: improves wordexp/glob detection and messaging

This commit is contained in:
李通洲
2025-11-05 10:10:08 +08:00
parent 302b8a7b1b
commit 7638e0e4a1
2 changed files with 6 additions and 1 deletions
+6
View File
@@ -1823,8 +1823,14 @@ if(NOT WIN32)
CHECK_INCLUDE_FILE("wordexp.h" HAVE_WORDEXP)
if(HAVE_WORDEXP)
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_WORDEXP=1)
message(STATUS "wordexp.h found, wordexp support enabled")
else()
set(ENABLE_WORDEXP OFF)
endif()
endif()
if(NOT ENABLE_WORDEXP)
message(STATUS "wordexp.h not found or disabled, glob used instead")
endif()
if(ENABLE_THREADS AND CMAKE_USE_PTHREADS_INIT)
CHECK_INCLUDE_FILE("pthread_np.h" HAVE_PTHREAD_NP)
if(HAVE_PTHREAD_NP)
-1
View File
@@ -16,7 +16,6 @@
#if FF_HAVE_WORDEXP
#include <wordexp.h>
#else
#warning "<wordexp.h> is not available, use glob(3) instead"
#include <glob.h>
#endif