Skip to content

Commit 4b3241a

Browse files
committed
CMake: try fixing detection of pthread_timedjoin_np
1 parent d37bf72 commit 4b3241a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,11 +1210,13 @@ if(NOT WIN32)
12101210
if(HAVE_WORDEXP)
12111211
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_WORDEXP=1)
12121212
endif()
1213-
if(ENABLE_THREADS)
1213+
if(ENABLE_THREADS AND CMAKE_USE_PTHREADS_INIT)
12141214
CHECK_INCLUDE_FILE("pthread_np.h" HAVE_PTHREAD_NP)
12151215
if(HAVE_PTHREAD_NP)
12161216
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_PTHREAD_NP=1)
1217+
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} pthread_np.h)
12171218
endif()
1219+
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} Threads::Threads)
12181220
check_function_exists("pthread_timedjoin_np" HAVE_TIMEDJOIN_NP)
12191221
if(HAVE_TIMEDJOIN_NP)
12201222
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_TIMEDJOIN_NP=1)

0 commit comments

Comments
 (0)