| Summary: | SDL2 Cmake: VIDEO_COCOA check fails on OS X; VIDEO_COCOA sources aren't compiled. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Jake Kerr <kodafox> |
| Component: | build | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Mac OS X (All) | ||
| Attachments: | A patch that fixes the CheckCOCOA cmake macro | ||
Fixed, thanks! http://hg.libsdl.org/SDL/rev/1089a8a701c3 |
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.