-
Notifications
You must be signed in to change notification settings - Fork 60
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
cmake: always use pthread outside of MSVC #1305
base: master
Are you sure you want to change the base?
Conversation
I don't think we should add the flag except where it is actually needed. |
How do we know it's actually needed? Isn't just using threads makes it needed? |
Normally you don't have to request linking to pthreads unless you directly use the pthread API, e.g. In the non-Windows engine, we do call |
So, how do we know if FreeBSD requires that flag? |
Well if you want, you can test whether it builds with |
As said in first post I tested the build with this flag on both Linux, FreeBSD, macOS and MinGW (and even PNaCl). In all cases it builds, and the flag is accepted for both compilation and linking. |
Oops typo, I meant you can test whether it builds WITHOUT FreeBSD is the same situation like Mac, if you base it on whether the pthread API is actually used engine would need it but not gamelogic. |
Always use pthread outside of MSVC.
After enabling it unconditionally I seen no build issue with Linux (GCC and Clang), macOS (AppleClang), FreeBSD (Clang), MinGW, PNaCl.
Also, CMake reported the flags to be supported in all cases, so we may make the flags mandatory.
It happens that the linker flag was lost in translation in #1997:
So I re-added it. It being missing did not bring any issue into all our builds (either on my end, either in our CI), but this is better like this I guess.