Update CMakeLists.txt#4704
Conversation
pthread has been checked in build/cmake/CMakeLists.txt; there's no need to check it again. On Windows, zstd can be built without winpthreads. It may check for existence of a pthread library, but nothing is linked from it. However, this causes errors when no pthread library is available. Either way, this check isn't meaningful.
|
Hi @lhmouse! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
There was a problem hiding this comment.
Pull request overview
This PR updates the CMake build for the pzstd contrib target to stop hard-failing when CMake detects a non-pthreads threading implementation (notably on Windows), aligning with the project’s ability to build on Windows without linking a pthread library.
Changes:
- Remove the
CMAKE_USE_PTHREADS_INITgating and associatedSEND_ERRORforpzstd. - Always link
pzstdagainst${CMAKE_THREAD_LIBS_INIT}(which may be empty on platforms where no extra thread lib is needed).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
pthread has been checked in build/cmake/CMakeLists.txt; there's no need to check it again.
On Windows, zstd can be built without winpthreads. It may check for existence of a pthread library, but nothing is linked from it. However, this causes errors when no pthread library is available.
Either way, this check isn't meaningful.