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 - CMake compilation fails on OSX Due to improper PTHREAD detection.
Summary: CMake compilation fails on OSX Due to improper PTHREAD detection.
Status: RESOLVED WORKSFORME
Alias: None
Product: SDL
Classification: Unclassified
Component: thread (show other bugs)
Version: 2.0.0
Hardware: x86 Mac OS X 10.8
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: triage-2.0.4
Depends on:
Blocks:
 
Reported: 2013-07-12 03:49 UTC by Skyler Saleh
Modified: 2015-02-20 04:21 UTC (History)
0 users

See Also:


Attachments
A patch for cmake/sdlchecks.cmake that resolves mac os build problems. (741 bytes, patch)
2013-07-12 03:49 UTC, Skyler Saleh
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.