configure.in
changeset 11808 510c0e047122
parent 11762 c4900725a75a
child 11829 fcbafc9e443c
equal deleted inserted replaced
11807:6b3d9e08c586 11808:510c0e047122
  2064 {
  2064 {
  2065     AC_ARG_ENABLE(render-metal,
  2065     AC_ARG_ENABLE(render-metal,
  2066 AC_HELP_STRING([--enable-render-metal], [enable the Metal render driver [[default=yes]]]),
  2066 AC_HELP_STRING([--enable-render-metal], [enable the Metal render driver [[default=yes]]]),
  2067                                 , enable_render_metal=yes)
  2067                                 , enable_render_metal=yes)
  2068     if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
  2068     if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
  2069         dnl This should maybe make sure you have a supported SDK version.
  2069         save_CFLAGS="$CFLAGS"
  2070         AC_DEFINE(SDL_VIDEO_RENDER_METAL, 1, [ ])
  2070         dnl Work around that we don't have Objective-C support in autoconf
  2071         SOURCES="$SOURCES $srcdir/src/render/metal/*.m"
  2071         CFLAGS="$CFLAGS -x objective-c"
  2072         SUMMARY_video="${SUMMARY_video} metal"
  2072         AC_MSG_CHECKING(for Metal framework)
       
  2073         have_metal=no
       
  2074         AC_TRY_COMPILE([
       
  2075           #import <Cocoa/Cocoa.h>
       
  2076           #import <Metal/Metal.h>
       
  2077           #import <QuartzCore/CAMetalLayer.h>
       
  2078 
       
  2079           #if !TARGET_CPU_X86_64
       
  2080           #error Metal doesn't work on this configuration
       
  2081           #endif
       
  2082         ],[
       
  2083         ],[
       
  2084         have_metal=yes
       
  2085         ])
       
  2086         CFLAGS="$save_CFLAGS"
       
  2087         AC_MSG_RESULT($have_metal)
       
  2088         if test x$have_metal = xyes; then
       
  2089             AC_DEFINE(SDL_VIDEO_RENDER_METAL, 1, [ ])
       
  2090             SOURCES="$SOURCES $srcdir/src/render/metal/*.m"
       
  2091             SUMMARY_video="${SUMMARY_video} metal"
       
  2092         fi
  2073     fi
  2093     fi
  2074 }
  2094 }
  2075 
  2095 
  2076 
  2096 
  2077 dnl Find DirectFB
  2097 dnl Find DirectFB