8000 cmake: Fix exporting -pthread to pkgconfig by dg0yt · Pull Request #965 · c-ares/c-ares · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cmake: Fix exporting -pthread to pkgconfig #965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 26, 2025
Merged

Conversation

dg0yt
Copy link
Contributor
@dg0yt dg0yt commented Jan 26, 2025

Before this change, libcares.pc contained -l-pthread.
Noticed in the vcpkg port.

@bradh352
Copy link
Member

I'm assuming that means THREADS_PREFER_PTHREAD_FLAG is being set somewhere, since that's not otherwise the default behavior in cmake.

Fix seems reasonable though.

@dg0yt
Copy link
Contributor Author
dg0yt commented Jan 26, 2025

I'm assuming that means THREADS_PREFER_PTHREAD_FLAG is being set somewhere, since that's not otherwise the default behavior in cmake.

It is recommended, and it is there:

SET (CMAKE_THREAD_PREFER_PTHREAD TRUE)

@bradh352
Copy link
Member

odd that docs show THREADS_PREFER_PTHREAD_FLAG as the variable name. https://cmake.org/cmake/help/latest/module/FindThreads.html

@bradh352 bradh352 merged commit d41db1b into c-ares:main Jan 26, 2025
25 of 26 checks passed
@dg0yt
Copy link
Contributor Author
dg0yt commented Jan 26, 2025

You are right, it is a different identifier.

The issue came up in the android builds. Maybe it came from the toolchain. THREADS_PREFER_PTHREAD_FLAG is more a toolchain setting than a project setting - users probably want the same configuration for a given target platform.

@dg0yt dg0yt deleted the pkgconfig branch January 26, 2025 15:59
bradh352 pushed a commit that referenced this pull request Apr 5, 2025
Before this change, libcares.pc contained ` -l-pthread`.  

Signed-off-by: Kai Pastor (@dg0yt)
bradh352 pushed a commit that referenced this pull request Apr 5, 2025
Before this change, libcares.pc contained ` -l-pthread`.  

Signed-off-by: Kai Pastor (@dg0yt)
bradh352 pushed a commit that referenced this pull request Apr 5, 2025
Before this change, libcares.pc contained ` -l-pthread`.

Signed-off-by: Kai Pastor (@dg0yt)
bradh352 pushed a commit that referenced this pull request Apr 5, 2025
Before this change, libcares.pc contained ` -l-pthread`.

Signed-off-by: Kai Pastor (@dg0yt)
bradh352 pushed a commit that referenced this pull request Apr 5, 2025
Before this change, libcares.pc contained ` -l-pthread`.

Signed-off-by: Kai Pastor (@dg0yt)
bradh352 pushed a commit that referenced this pull request Apr 5, 2025
Before this change, libcares.pc contained ` -l-pthread`.

Signed-off-by: Kai Pastor (@dg0yt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0