configure.ac
changeset 12998 b87ba0fad17e
parent 12984 774ceeac9335
child 12999 a7ca9815bc79
     1.1 --- a/configure.ac	Sun Aug 04 23:30:55 2019 -0300
     1.2 +++ b/configure.ac	Mon Aug 05 12:35:32 2019 -0300
     1.3 @@ -2048,10 +2048,13 @@
     1.4  
     1.5  CheckMETAL()
     1.6  {
     1.7 +    AC_ARG_ENABLE(video-metal,
     1.8 +AC_HELP_STRING([--enable-video-metal], [include Metal support [[default=yes]]]),
     1.9 +              , enable_video_metal=yes)
    1.10      AC_ARG_ENABLE(render-metal,
    1.11  AS_HELP_STRING([--enable-render-metal], [enable the Metal render driver [[default=yes]]]),
    1.12                                  , enable_render_metal=yes)
    1.13 -    if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
    1.14 +    if test x$enable_video = xyes -a x$enable_video_metal = xyes; then
    1.15          save_CFLAGS="$CFLAGS"
    1.16          dnl Work around that we don't have Objective-C support in autoconf
    1.17          CFLAGS="$CFLAGS -x objective-c"
    1.18 @@ -2072,10 +2075,14 @@
    1.19          CFLAGS="$save_CFLAGS"
    1.20          AC_MSG_RESULT($have_metal)
    1.21          if test x$have_metal = xyes; then
    1.22 -            AC_DEFINE(SDL_VIDEO_RENDER_METAL, 1, [ ])
    1.23 -            SOURCES="$SOURCES $srcdir/src/render/metal/*.m"
    1.24 +            AC_DEFINE(SDL_VIDEO_METAL, 1, [ ])
    1.25 +            if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
    1.26 +                AC_DEFINE(SDL_VIDEO_RENDER_METAL, 1, [ ])
    1.27 +                SOURCES="$SOURCES $srcdir/src/render/metal/*.m"
    1.28 +            fi
    1.29              SUMMARY_video="${SUMMARY_video} metal"
    1.30          else
    1.31 +            enable_video_metal=no
    1.32              enable_render_metal=no
    1.33          fi
    1.34      fi
    1.35 @@ -3828,7 +3835,7 @@
    1.36          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
    1.37          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
    1.38  
    1.39 -        if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
    1.40 +        if test x$enable_video_metal = xyes -o x$enable_video_vulkan = xyes; then
    1.41              EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Metal"
    1.42          fi
    1.43          ;;
    1.44 @@ -3910,7 +3917,7 @@
    1.45          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
    1.46          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
    1.47  
    1.48 -        if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
    1.49 +        if test x$enable_video_metal = xyes -o x$enable_video_vulkan = xyes; then
    1.50              EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal"
    1.51          fi
    1.52          ;;