cmake/macros.cmake
changeset 7182 1089a8a701c3
parent 6674 45a21e50ba5e
child 9465 bf1da29c9509
--- a/cmake/macros.cmake	Thu May 16 00:48:20 2013 -0700
+++ b/cmake/macros.cmake	Thu May 16 00:52:33 2013 -0700
@@ -63,3 +63,11 @@
     set(${_OUTPUT} "${_LPREFIX}${_ITEM} ${${_OUTPUT}}")
   endforeach()
 endmacro()
+
+macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR)
+  set(PREV_REQUIRED_DEFS "${CMAKE_REQUIRED_DEFINITIONS}")
+  set(CMAKE_REQUIRED_DEFINITIONS "-ObjC ${PREV_REQUIRED_DEFS}")
+  CHECK_C_SOURCE_COMPILES(${SOURCE} ${VAR})
+  set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}")
+endmacro()
+