We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1960

Summary: CMake compilation fails on OSX Due to improper PTHREAD detection.
Product: SDL Reporter: Skyler Saleh <skylersaleh>
Component: threadAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED WORKSFORME QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 Keywords: triage-2.0.4
Version: 2.0.0   
Hardware: x86   
OS: Mac OS X 10.8   
Attachments: A patch for cmake/sdlchecks.cmake that resolves mac os build problems.

Description Skyler Saleh 2013-07-12 03:49:02 UTC
Created attachment 1221 [details]
A patch for cmake/sdlchecks.cmake that resolves mac os build problems.

The projects generated using the CMake build systems do not successfully build under MacOSX, as the CMake script does not properly detect the presence of the pthread library. This patch resolves the problem.
Comment 1 Ryan C. Gordon 2015-02-19 05:22:17 UTC
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though!
Comment 2 Ryan C. Gordon 2015-02-20 04:21:21 UTC
Mac OS X doesn't need "-lpthread" on the linker command line, though; unlike Linux, there isn't a separate libpthread, but it's just part of libSystem, Mac OS X's standard C runtime.

It looks like the latest compiler tools from apple will accept "-lpthread" without complaint, but the binary it produces is still linked against just libSystem.

Otherwise, we already hit the DARWIN section of that code, which sets the same compiler flags.

It's possible something has changed in the build system since this was reported, but it works okay for me.

Please reopen this bug if I'm totally misunderstanding the problem, though!

--ryan.