CMakeLists.txt
changeset 11367 e8fc755a89e8
parent 11365 a9bd2625fa01
child 11378 dc769c104554
equal deleted inserted replaced
11366:1e4fe1678a00 11367:e8fc755a89e8
   327 set_option(VIDEO_VIVANTE       "Use Vivante EGL video driver" ${UNIX_SYS})
   327 set_option(VIDEO_VIVANTE       "Use Vivante EGL video driver" ${UNIX_SYS})
   328 dep_option(VIDEO_VULKAN        "Enable Vulkan surface creation" ON "ANDROID OR APPLE OR LINUX OR WINDOWS" OFF)
   328 dep_option(VIDEO_VULKAN        "Enable Vulkan surface creation" ON "ANDROID OR APPLE OR LINUX OR WINDOWS" OFF)
   329 set_option(VIDEO_KMSDRM        "Use KMS DRM video driver" ${UNIX_SYS})
   329 set_option(VIDEO_KMSDRM        "Use KMS DRM video driver" ${UNIX_SYS})
   330 dep_option(KMSDRM_SHARED       "Dynamically load KMS DRM support" ON "VIDEO_KMSDRM" OFF)
   330 dep_option(KMSDRM_SHARED       "Dynamically load KMS DRM support" ON "VIDEO_KMSDRM" OFF)
   331 
   331 
   332 if(VIDEO_VULKAN)
       
   333   set(VULKAN_SDK $ENV{VULKAN_SDK} CACHE PATH "Location of Vulkan headers' grandparent, e.g. /foo when headers are in /foo/include/vulkan.")
       
   334 endif()
       
   335 
       
   336 # TODO: We should (should we?) respect cmake's ${BUILD_SHARED_LIBS} flag here
   332 # TODO: We should (should we?) respect cmake's ${BUILD_SHARED_LIBS} flag here
   337 # The options below are for compatibility to configure's default behaviour.
   333 # The options below are for compatibility to configure's default behaviour.
   338 set(SDL_SHARED ${SDL_SHARED_ENABLED_BY_DEFAULT} CACHE BOOL "Build a shared version of the library")
   334 set(SDL_SHARED ${SDL_SHARED_ENABLED_BY_DEFAULT} CACHE BOOL "Build a shared version of the library")
   339 set(SDL_STATIC ON CACHE BOOL "Build a static version of the library")
   335 set(SDL_STATIC ON CACHE BOOL "Build a static version of the library")
   340 
   336 
   872     }
   868     }
   873     " VULKAN_PASSED_ANDROID_CHECKS)
   869     " VULKAN_PASSED_ANDROID_CHECKS)
   874     if(NOT VULKAN_PASSED_ANDROID_CHECKS)
   870     if(NOT VULKAN_PASSED_ANDROID_CHECKS)
   875       set(VIDEO_VULKAN OFF)
   871       set(VIDEO_VULKAN OFF)
   876       message(STATUS "Vulkan doesn't work on this configuration")
   872       message(STATUS "Vulkan doesn't work on this configuration")
   877     else()
       
   878       CheckVulkanHeaders()
       
   879     endif()
   873     endif()
   880   endif()
   874   endif()
   881 
   875 
   882   CheckPTHREAD()
   876   CheckPTHREAD()
   883 
   877 
  1039         list(APPEND EXTRA_LIBS ${IBUS_LIBRARIES})
  1033         list(APPEND EXTRA_LIBS ${IBUS_LIBRARIES})
  1040       endif()
  1034       endif()
  1041     endif()
  1035     endif()
  1042 
  1036 
  1043     check_include_file("fcitx/frontend.h" HAVE_FCITX_FRONTEND_H)
  1037     check_include_file("fcitx/frontend.h" HAVE_FCITX_FRONTEND_H)
  1044 
       
  1045     CheckVulkanHeaders()
       
  1046   endif()
  1038   endif()
  1047 
  1039 
  1048   if(INPUT_TSLIB)
  1040   if(INPUT_TSLIB)
  1049     check_c_source_compiles("
  1041     check_c_source_compiles("
  1050         #include \"tslib.h\"
  1042         #include \"tslib.h\"
  1299       set(SDL_VIDEO_OPENGL_EGL 1)
  1291       set(SDL_VIDEO_OPENGL_EGL 1)
  1300       set(SDL_VIDEO_OPENGL_ES2 1)
  1292       set(SDL_VIDEO_OPENGL_ES2 1)
  1301       set(SDL_VIDEO_RENDER_OGL_ES2 1)
  1293       set(SDL_VIDEO_RENDER_OGL_ES2 1)
  1302       set(HAVE_VIDEO_OPENGLES TRUE)
  1294       set(HAVE_VIDEO_OPENGLES TRUE)
  1303     endif()
  1295     endif()
  1304 
       
  1305     CheckVulkanHeaders()
       
  1306   endif()
  1296   endif()
  1307 
  1297 
  1308   if(SDL_JOYSTICK)
  1298   if(SDL_JOYSTICK)
  1309     file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/windows/*.c)
  1299     file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/windows/*.c)
  1310     set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
  1300     set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
  1443     set(HAVE_SDL_FILESYSTEM TRUE)
  1433     set(HAVE_SDL_FILESYSTEM TRUE)
  1444   endif()
  1434   endif()
  1445 
  1435 
  1446   # Actually load the frameworks at the end so we don't duplicate include.
  1436   # Actually load the frameworks at the end so we don't duplicate include.
  1447   if (VIDEO_VULKAN)
  1437   if (VIDEO_VULKAN)
  1448     CheckVulkanHeaders()
  1438     find_library(QUARTZCORE QuartzCore)
  1449     if(HAVE_VULKAN_H)
  1439     list(APPEND EXTRA_LIBS ${QUARTZCORE})
  1450       find_library(QUARTZCORE QuartzCore)
       
  1451       list(APPEND EXTRA_LIBS ${QUARTZCORE})
       
  1452     endif()
       
  1453   endif()
  1440   endif()
  1454   if(SDL_FRAMEWORK_COREVIDEO)
  1441   if(SDL_FRAMEWORK_COREVIDEO)
  1455     find_library(COREVIDEO CoreVideo)
  1442     find_library(COREVIDEO CoreVideo)
  1456     list(APPEND EXTRA_LIBS ${COREVIDEO})
  1443     list(APPEND EXTRA_LIBS ${COREVIDEO})
  1457   endif()
  1444   endif()
  1528   endif()
  1515   endif()
  1529 
  1516 
  1530   CheckPTHREAD()
  1517   CheckPTHREAD()
  1531 endif()
  1518 endif()
  1532 
  1519 
  1533 if(VIDEO_VULKAN AND HAVE_VULKAN_H AND (NOT APPLE OR QUARTZCORE))
  1520 if(VIDEO_VULKAN AND (NOT APPLE OR QUARTZCORE))
  1534   set(SDL_VIDEO_VULKAN_SURFACE 1)
  1521   set(SDL_VIDEO_VULKAN_SURFACE 1)
  1535 endif()
  1522 endif()
  1536 
  1523 
  1537 # Dummies
  1524 # Dummies
  1538 # configure.in does it differently:
  1525 # configure.in does it differently: