summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2022-04-13 14:30:54 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2022-04-13 14:30:54 +0200
commitf5659a122d47468cc6d2e903ea1280a75571b6c3 (patch)
tree23e02b7512ae6dacd5583d2d002d5bbaa1381153
parent44e9118c023ae3697fc40276ab3a50b44477986c (diff)
downloadlibxml2-f5659a122d47468cc6d2e903ea1280a75571b6c3.tar.gz
cmake: Fix build without thread support
Only check for pthread.h if threads are enabled. Fixes #367.
-rw-r--r--CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4cd2db91..12dd86b7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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()