|
| 1 | +diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 2 | +index ef0c3ae..b845d6f 100644 |
| 3 | +--- a/CMakeLists.txt |
| 4 | ++++ b/CMakeLists.txt |
| 5 | +@@ -168,14 +168,16 @@ if(CROSS_COMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows") |
| 6 | + endif() |
| 7 | + |
| 8 | + # Check for required dependencies |
| 9 | +-if(NOT WIN32) |
| 10 | ++set(FYAML_LIBS "-L\${libdir} -lfyaml") |
| 11 | ++if(NOT WIN32 AND NOT ANDROID) |
| 12 | + set(CMAKE_THREAD_PREFER_PTHREAD TRUE) |
| 13 | + set(THREADS_PREFER_PTHREAD_FLAG TRUE) |
| 14 | + find_package(Threads REQUIRED) |
| 15 | + if(NOT CMAKE_USE_PTHREADS_INIT) |
| 16 | + message(FATAL_ERROR "Missing required pthread support") |
| 17 | + endif() |
| 18 | +-else() |
| 19 | ++ set(FYAML_LIBS "${FYAML_LIBS} -lpthread") |
| 20 | ++elif(WIN32) |
| 21 | + # Windows uses native threading APIs |
| 22 | + set(CMAKE_USE_WIN32_THREADS_INIT TRUE) |
| 23 | + endif() |
| 24 | +diff --git a/cmake/libfyaml-config.cmake.in b/cmake/libfyaml-config.cmake.in |
| 25 | +index d67173a..9bae080 100644 |
| 26 | +--- a/cmake/libfyaml-config.cmake.in |
| 27 | ++++ b/cmake/libfyaml-config.cmake.in |
| 28 | +@@ -16,9 +16,11 @@ set(libfyaml_HAS_LIBCLANG "@HAVE_LIBCLANG@") |
| 29 | + set(libfyaml_HAS_LIBYAML "@HAVE_LIBYAML@") |
| 30 | + |
| 31 | + # Required dependency: Threads |
| 32 | +-set(CMAKE_THREAD_PREFER_PTHREAD TRUE) |
| 33 | +-set(THREADS_PREFER_PTHREAD_FLAG TRUE) |
| 34 | +-find_dependency(Threads REQUIRED) |
| 35 | ++if(NOT WIN32 AND NOT ANDROID) |
| 36 | ++ set(CMAKE_THREAD_PREFER_PTHREAD TRUE) |
| 37 | ++ set(THREADS_PREFER_PTHREAD_FLAG TRUE) |
| 38 | ++ find_dependency(Threads REQUIRED) |
| 39 | ++endif() |
| 40 | + |
| 41 | + # Optional dependency: libclang (only if libfyaml was built with reflection support) |
| 42 | + if(libfyaml_HAS_LIBCLANG) |
| 43 | +diff --git a/cmake/libfyaml.pc.in b/cmake/libfyaml.pc.in |
| 44 | +index e57044c..f7faafc 100644 |
| 45 | +--- a/cmake/libfyaml.pc.in |
| 46 | ++++ b/cmake/libfyaml.pc.in |
| 47 | +@@ -6,5 +6,5 @@ includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@ |
| 48 | + Name: libfyaml |
| 49 | + Description: Fancy YAML 1.3 parser library |
| 50 | + Version: @PROJECT_VERSION@ |
| 51 | +-Libs: -L${libdir} -lfyaml -lpthread |
| 52 | ++Libs: @FYAML_LIBS@ |
| 53 | + Cflags: -I${includedir} |
0 commit comments