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 1839 - SDL2 Cmake: VIDEO_COCOA check fails on OS X; VIDEO_COCOA sources aren't compiled.
Summary: SDL2 Cmake: VIDEO_COCOA check fails on OS X; VIDEO_COCOA sources aren't compi...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.0
Hardware: x86 Mac OS X (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-06 02:01 UTC by Jake Kerr
Modified: 2013-05-16 03:52 UTC (History)
0 users

See Also:


Attachments
A patch that fixes the CheckCOCOA cmake macro (1.20 KB, patch)
2013-05-06 02:01 UTC, Jake Kerr
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jake Kerr 2013-05-06 02:01:40 UTC
Created attachment 1130 [details]
A patch that fixes the CheckCOCOA cmake macro

Because the CHECK_C_SOURCE_COMPILES macro writes the temporary source file as .c the compilation of the check fails in the imported <Cocoa/Cocoa.h>.
It's easy to get around by making an objc specific macro that temporarily sets CMAKE_REQUIRED_DEFINITIONS to include "-ObjC" (see patch).

Also *.m sources that are added to the SOURCE_FILES list need to be marked as a language that CMake knows about or they are simply skipped. See ("set_source_files_properties" in the patch).

The patch attached allowed me to build the library, and an example Cocoa app from the command line, which ran without error.
Comment 1 Sam Lantinga 2013-05-16 03:52:56 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/1089a8a701c3