cmake/sdlchecks.cmake
changeset 9164 494876610c49
parent 9127 a8c38ed1a674
child 9170 872d1b4b34a1
     1.1 --- a/cmake/sdlchecks.cmake	Wed Oct 15 09:14:09 2014 -0700
     1.2 +++ b/cmake/sdlchecks.cmake	Wed Oct 15 09:18:17 2014 -0700
     1.3 @@ -602,22 +602,33 @@
     1.4  
     1.5  # Requires:
     1.6  # - n/a
     1.7 -macro(CheckMX6)
     1.8 -  if(VIDEO_MX6)
     1.9 +macro(CheckVivante)
    1.10 +  if(VIDEO_VIVANTE)
    1.11      check_c_source_compiles("
    1.12 +        #include <gc_vdk.h>
    1.13 +        int main(int argc, char** argv) {}" HAVE_VIDEO_VIVANTE_VDK)
    1.14 +    check_c_source_compiles("
    1.15 +        #define LINUX
    1.16          #define EGL_API_FB
    1.17          #include <EGL/eglvivante.h>
    1.18 -        int main(int argc, char** argv) {}" HAVE_VIDEO_OPENGL_EGL_VIVANTE)
    1.19 -    if(HAVE_VIDEO_OPENGL_EGL_VIVANTE)
    1.20 -      set(HAVE_VIDEO_MX6 TRUE)
    1.21 +        int main(int argc, char** argv) {}" HAVE_VIDEO_VIVANTE_EGL_FB)
    1.22 +    if(HAVE_VIDEO_VIVANTE_VDK OR HAVE_VIDEO_VIVANTE_EGL_FB)
    1.23 +      set(HAVE_VIDEO_VIVANTE TRUE)
    1.24        set(HAVE_SDL_VIDEO TRUE)
    1.25  
    1.26 -      file(GLOB MX6_SOURCES ${SDL2_SOURCE_DIR}/src/video/mx6/*.c)
    1.27 -      set(SOURCE_FILES ${SOURCE_FILES} ${MX6_SOURCES})
    1.28 -      set(SDL_VIDEO_DRIVER_MX6 1)
    1.29 -    endif(HAVE_VIDEO_OPENGL_EGL_VIVANTE)
    1.30 -  endif(VIDEO_MX6)
    1.31 -endmacro(CheckMX6)
    1.32 +      file(GLOB VIVANTE_SOURCES ${SDL2_SOURCE_DIR}/src/video/vivante/*.c)
    1.33 +      set(SOURCE_FILES ${SOURCE_FILES} ${VIVANTE_SOURCES})
    1.34 +      set(SDL_VIDEO_DRIVER_VIVANTE 1)
    1.35 +      if(HAVE_VIDEO_VIVANTE_VDK)
    1.36 +        set(SDL_VIDEO_DRIVER_VIVANTE_VDK 1)
    1.37 +        list(APPEND EXTRA_LIBS VDK VIVANTE)
    1.38 +      else
    1.39 +        set(SDL_CFLAGS "${SDL_CFLAGS} -DLINUX -DEGL_API_FB")
    1.40 +        list(APPEND EXTRA_LIBS EGL)
    1.41 +      endif(HAVE_VIDEO_VIVANTE_VDK)
    1.42 +    endif(HAVE_VIDEO_VIVANTE_VDK OR HAVE_VIDEO_VIVANTE_EGL_FB)
    1.43 +  endif(VIDEO_VIVANTE)
    1.44 +endmacro(CheckVivante)
    1.45  
    1.46  # Requires:
    1.47  # - nada