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 2392

Summary: Wrong flags in CHECK_OBJC_SOURCE_COMPILES
Product: SDL Reporter: Ivan Vashchaev <vivkin>
Component: buildAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 Keywords: triage-2.0.4
Version: HG 2.1   
Hardware: x86   
OS: Mac OS X 10.8   

Description Ivan Vashchaev 2014-02-11 19:49:59 UTC
When generating XCode project files or using GCC, instead of Clang, CHECK_OBJC_SOURCE_COMPILES always fail

Fix:
diff -r e749005cfd72 cmake/macros.cmake
--- a/cmake/macros.cmake	Mon Feb 10 13:40:02 2014 -0800
+++ b/cmake/macros.cmake	Tue Feb 11 23:28:14 2014 +0400
@@ -66,7 +66,7 @@
 
 macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR)
   set(PREV_REQUIRED_DEFS "${CMAKE_REQUIRED_DEFINITIONS}")
-  set(CMAKE_REQUIRED_DEFINITIONS "-ObjC ${PREV_REQUIRED_DEFS}")
+  set(CMAKE_REQUIRED_DEFINITIONS "-x objective-c ${PREV_REQUIRED_DEFS}")
   CHECK_C_SOURCE_COMPILES(${SOURCE} ${VAR})
   set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}")
 endmacro()
Comment 1 Ryan C. Gordon 2015-02-19 05:22:16 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-04-08 00:06:25 UTC
We're not actually using this macro anymore, but I'll put the fix in, in case this gets used again in the future.

This patch is now https://hg.libsdl.org/SDL/rev/bf1da29c9509, thanks!

--ryan.