|
1 | | -diff --git a/CMakeLists.txt b/CMakeLists.txt |
2 | | -index ef0c3ae..f5f23c2 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 | | -+elseif(WIN32) |
21 | | - # Windows uses native threading APIs |
22 | | - set(CMAKE_USE_WIN32_THREADS_INIT TRUE) |
23 | | - endif() |
24 | | -@@ -1114,7 +1116,7 @@ target_include_directories(fyaml_static |
25 | | - ${CMAKE_CURRENT_BINARY_DIR} |
26 | | - ) |
27 | | - |
28 | | --if(NOT WIN32) |
29 | | -+if(NOT WIN32 AND NOT ANDROID) |
30 | | - target_link_libraries(fyaml_static |
31 | | - PUBLIC |
32 | | - Threads::Threads |
33 | | -@@ -1178,12 +1180,13 @@ target_include_directories(fyaml |
34 | | - ${CMAKE_CURRENT_SOURCE_DIR}/src/blake3 |
35 | | - ) |
36 | | - |
37 | | --if(NOT WIN32) |
38 | | -+if(NOT WIN32 AND NOT ANDROID) |
39 | | - target_link_libraries(fyaml |
40 | | - PUBLIC |
41 | | - Threads::Threads |
42 | | - ) |
43 | | - else() |
44 | | -+ # Android needs no extra libraries for threading (uses bionic libc) |
45 | | - # Windows needs no extra libraries for threading (uses kernel32) |
46 | | - endif() |
47 | | - |
48 | | -diff --git a/cmake/libfyaml-config.cmake.in b/cmake/libfyaml-config.cmake.in |
49 | | -index d67173a..9bae080 100644 |
50 | | ---- a/cmake/libfyaml-config.cmake.in |
51 | | -+++ b/cmake/libfyaml-config.cmake.in |
52 | | -@@ -16,9 +16,11 @@ set(libfyaml_HAS_LIBCLANG "@HAVE_LIBCLANG@") |
53 | | - set(libfyaml_HAS_LIBYAML "@HAVE_LIBYAML@") |
54 | | - |
55 | | - # Required dependency: Threads |
56 | | --set(CMAKE_THREAD_PREFER_PTHREAD TRUE) |
57 | | --set(THREADS_PREFER_PTHREAD_FLAG TRUE) |
58 | | --find_dependency(Threads REQUIRED) |
59 | | -+if(NOT WIN32 AND NOT ANDROID) |
60 | | -+ set(CMAKE_THREAD_PREFER_PTHREAD TRUE) |
61 | | -+ set(THREADS_PREFER_PTHREAD_FLAG TRUE) |
62 | | -+ find_dependency(Threads REQUIRED) |
63 | | -+endif() |
64 | | - |
65 | | - # Optional dependency: libclang (only if libfyaml was built with reflection support) |
66 | | - if(libfyaml_HAS_LIBCLANG) |
67 | 1 | diff --git a/cmake/libfyaml.pc.in b/cmake/libfyaml.pc.in |
68 | | -index e57044c..f7faafc 100644 |
| 2 | +index e57044c..a7da26e 100644 |
69 | 3 | --- a/cmake/libfyaml.pc.in |
70 | 4 | +++ b/cmake/libfyaml.pc.in |
71 | 5 | @@ -6,5 +6,5 @@ includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@ |
72 | 6 | Name: libfyaml |
73 | 7 | Description: Fancy YAML 1.3 parser library |
74 | 8 | Version: @PROJECT_VERSION@ |
75 | 9 | -Libs: -L${libdir} -lfyaml -lpthread |
76 | | -+Libs: @FYAML_LIBS@ |
| 10 | ++Libs: -L${libdir} -lfyaml @CMAKE_THREAD_LIBS_INIT@ |
77 | 11 | Cflags: -I${includedir} |
0 commit comments