diff --git a/CMakeLists.txt b/CMakeLists.txt index 85fe3cb..a10921b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,11 +176,10 @@ if(UNIX) check_include_file(pthread.h HAVE_PTHREAD_H) if(HAVE_PTHREAD_H) set(PHYSFS_HAVE_THREAD_SUPPORT TRUE) - endif() - - find_library(PTHREAD_LIBRARY pthread) - if(PTHREAD_LIBRARY) - set(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${PTHREAD_LIBRARY}) + find_library(PTHREAD_LIBRARY pthread) + if(PTHREAD_LIBRARY) + set(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${PTHREAD_LIBRARY}) + endif() endif() endif() endif()