configure
changeset 12998 b87ba0fad17e
parent 12984 774ceeac9335
child 12999 a7ca9815bc79
     1.1 --- a/configure	Sun Aug 04 23:30:55 2019 -0300
     1.2 +++ b/configure	Mon Aug 05 12:35:32 2019 -0300
     1.3 @@ -869,6 +869,7 @@
     1.4  enable_video_x11_vm
     1.5  enable_video_vivante
     1.6  enable_video_cocoa
     1.7 +enable_video_metal
     1.8  enable_render_metal
     1.9  enable_video_directfb
    1.10  enable_directfb_shared
    1.11 @@ -1647,6 +1648,7 @@
    1.12    --enable-video-x11-vm   use X11 VM extension for fullscreen [[default=yes]]
    1.13    --enable-video-vivante  use Vivante EGL video driver [[default=yes]]
    1.14    --enable-video-cocoa    use Cocoa video driver [[default=yes]]
    1.15 +  --enable-video-metal    include Metal support [[default=yes]]
    1.16    --enable-render-metal   enable the Metal render driver [[default=yes]]
    1.17    --enable-video-directfb use DirectFB video driver [[default=no]]
    1.18    --enable-directfb-shared
    1.19 @@ -21530,6 +21532,13 @@
    1.20  
    1.21  CheckMETAL()
    1.22  {
    1.23 +    # Check whether --enable-video-metal was given.
    1.24 +if test "${enable_video_metal+set}" = set; then :
    1.25 +  enableval=$enable_video_metal;
    1.26 +else
    1.27 +  enable_video_metal=yes
    1.28 +fi
    1.29 +
    1.30      # Check whether --enable-render-metal was given.
    1.31  if test "${enable_render_metal+set}" = set; then :
    1.32    enableval=$enable_render_metal;
    1.33 @@ -21537,7 +21546,7 @@
    1.34    enable_render_metal=yes
    1.35  fi
    1.36  
    1.37 -    if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
    1.38 +    if test x$enable_video = xyes -a x$enable_video_metal = xyes; then
    1.39          save_CFLAGS="$CFLAGS"
    1.40                  CFLAGS="$CFLAGS -x objective-c"
    1.41          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Metal framework" >&5
    1.42 @@ -21574,11 +21583,17 @@
    1.43  $as_echo "$have_metal" >&6; }
    1.44          if test x$have_metal = xyes; then
    1.45  
    1.46 +$as_echo "#define SDL_VIDEO_METAL 1" >>confdefs.h
    1.47 +
    1.48 +            if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
    1.49 +
    1.50  $as_echo "#define SDL_VIDEO_RENDER_METAL 1" >>confdefs.h
    1.51  
    1.52 -            SOURCES="$SOURCES $srcdir/src/render/metal/*.m"
    1.53 +                SOURCES="$SOURCES $srcdir/src/render/metal/*.m"
    1.54 +            fi
    1.55              SUMMARY_video="${SUMMARY_video} metal"
    1.56          else
    1.57 +            enable_video_metal=no
    1.58              enable_render_metal=no
    1.59          fi
    1.60      fi
    1.61 @@ -25064,7 +25079,7 @@
    1.62          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
    1.63          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
    1.64  
    1.65 -        if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
    1.66 +        if test x$enable_video_metal = xyes -o x$enable_video_vulkan = xyes; then
    1.67              EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Metal"
    1.68          fi
    1.69          ;;
    1.70 @@ -25158,7 +25173,7 @@
    1.71          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
    1.72          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
    1.73  
    1.74 -        if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
    1.75 +        if test x$enable_video_metal = xyes -o x$enable_video_vulkan = xyes; then
    1.76              EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal"
    1.77          fi
    1.78          ;;