stewartmatheson / projectx

0 stars 1 forks source link

Determine and link against threading implementation #72

Closed msbit closed 3 years ago

msbit commented 3 years ago

Linux needs pthread to be linked in, so add a dependency on the CMake Threads package to bring it in

msbit commented 3 years ago

The Threads package detects the threading implementation, so it works on all platforms, using the appropriate build arguments (seemingly none on win32 and macos).

stewartmatheson commented 3 years ago

Oh wow, so this is provided by CMake. CMake was a bit of a brain bender at the start but the more I use it the more I like it.

msbit commented 3 years ago

Yeah, if you have a nice package for detection, like Threads in this case, it's brilliant. It can be a bit more frustrating if you're trying to do something outside of that, but I could probably learn how to write custom CMake packages and solve that problem :)