1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00

cmake: Fix build without thread support

Only check for pthread.h if threads are enabled.

Fixes #367.
This commit is contained in:
Nick Wellnhofer 2022-04-13 14:30:54 +02:00
parent 44e9118c02
commit f5659a122d

View File

@ -179,7 +179,6 @@ else()
check_include_files(netdb.h HAVE_NETDB_H)
check_include_files(netinet/in.h HAVE_NETINET_IN_H)
check_include_files(poll.h HAVE_POLL_H)
check_include_files(pthread.h HAVE_PTHREAD_H)
check_function_exists(putenv HAVE_PUTENV)
check_function_exists(rand_r HAVE_RAND_R)
check_include_files(resolv.h HAVE_RESOLV_H)
@ -375,6 +374,8 @@ if(LIBXML2_WITH_THREADS)
target_compile_definitions(LibXml2 PRIVATE _REENTRANT)
if(WIN32)
target_compile_definitions(LibXml2 PRIVATE HAVE_WIN32_THREADS)
else()
check_include_files(pthread.h HAVE_PTHREAD_H)
endif()
endif()