Skip to content

Commit 0f7cecc

Browse files
committed
Test simpler pthread patch
1 parent abef147 commit 0f7cecc

2 files changed

Lines changed: 3 additions & 69 deletions

File tree

ports/libfyaml/pthread.diff

Lines changed: 2 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,11 @@
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)
671
diff --git a/cmake/libfyaml.pc.in b/cmake/libfyaml.pc.in
68-
index e57044c..f7faafc 100644
2+
index e57044c..a7da26e 100644
693
--- a/cmake/libfyaml.pc.in
704
+++ b/cmake/libfyaml.pc.in
715
@@ -6,5 +6,5 @@ includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
726
Name: libfyaml
737
Description: Fancy YAML 1.3 parser library
748
Version: @PROJECT_VERSION@
759
-Libs: -L${libdir} -lfyaml -lpthread
76-
+Libs: @FYAML_LIBS@
10+
+Libs: -L${libdir} -lfyaml @CMAKE_THREAD_LIBS_INIT@
7711
Cflags: -I${includedir}

versions/l-/libfyaml.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"versions": [
33
{
4-
"git-tree": "ee8f94ac29df7882e1157c95474edd5e0b744b2c",
4+
"git-tree": "746d545f2c70e9478d64abd29bb253657ed339ed",
55
"version": "0.9.6",
66
"port-version": 0
77
}

0 commit comments

Comments
 (0)