Maratyszcza / pthreadpool

Portable (POSIX/Windows/Emscripten) thread pool for C/C++
BSD 2-Clause "Simplified" License
342 stars 132 forks source link

cmake: add USE_SYSTEM_* options; support find_package(pthreadpool) #27

Open ConnorBaker opened 1 year ago

ConnorBaker commented 1 year ago

Similar to the work done in https://github.com/pytorch/pytorch/pull/37137, this adds the following CMake options:

This is particularly useful in the context of Nix, where we can build these libraries once and then re-use them elsewhere to avoid rebuilding vendors dependencies.

Additionally, adds a CMake configuration file to make it possible for CMake-based projects to use find_package to consume this library.

ConnorBaker commented 12 months ago

Updated to reflect comment from https://github.com/pytorch/cpuinfo/pull/153#discussion_r1254647992.

@Maratyszcza if you have the time, would you mind reviewing this?

petrhosek commented 4 months ago

I'd be interested in seeing this merged as well since we need this change for the https://github.com/google/ml-compiler-opt project. @Maratyszcza would it be possible to take a look?