OptionsEfl.cmake 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. set(PROJECT_VERSION_MAJOR 0)
  2. set(PROJECT_VERSION_MINOR 1)
  3. set(PROJECT_VERSION_PATCH 0)
  4. set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
  5. add_definitions(-DBUILDING_EFL__=1)
  6. if (NOT DEFINED ENABLE_WEBKIT2)
  7. set(ENABLE_WEBKIT2 ON)
  8. endif ()
  9. if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" AND NOT SHARED_CORE)
  10. message(FATAL_ERROR "Turn on the SHARED_CORE flag to make a debug build - e.g.\n build-webkit --efl --debug --cmakeargs=\"-DSHARED_CORE=ON\".\n")
  11. endif ()
  12. find_package(Cairo 1.10.2 REQUIRED)
  13. find_package(Fontconfig 2.8.0 REQUIRED)
  14. find_package(Sqlite REQUIRED)
  15. find_package(LibXml2 2.8.0 REQUIRED)
  16. find_package(LibXslt 1.1.7 REQUIRED)
  17. find_package(ICU REQUIRED)
  18. find_package(Threads REQUIRED)
  19. find_package(JPEG REQUIRED)
  20. find_package(PNG REQUIRED)
  21. find_package(ZLIB REQUIRED)
  22. find_package(GLIB 2.36.0 REQUIRED COMPONENTS gio gobject gthread)
  23. find_package(LibSoup 2.42.0 REQUIRED)
  24. set(WTF_USE_ICU_UNICODE 1)
  25. set(WTF_USE_SOUP 1)
  26. add_definitions(-DWTF_USE_GLIB=1)
  27. add_definitions(-DWTF_USE_SOUP=1)
  28. add_definitions(-DWTF_USE_ICU_UNICODE=1)
  29. add_definitions(-DWTF_USE_CAIRO=1)
  30. add_definitions(-DWTF_USE_CROSS_PLATFORM_CONTEXT_MENUS=1)
  31. set(WTF_OUTPUT_NAME wtf_efl)
  32. set(JavaScriptCore_OUTPUT_NAME javascriptcore_efl)
  33. set(WebCore_OUTPUT_NAME webcore_efl)
  34. set(WebKit_OUTPUT_NAME ewebkit)
  35. set(WebKit2_OUTPUT_NAME ewebkit2)
  36. set(DATA_INSTALL_DIR "share/${WebKit_OUTPUT_NAME}-${PROJECT_VERSION_MAJOR}" CACHE PATH "Installation path for theme data")
  37. set(THEME_BINARY_DIR ${CMAKE_BINARY_DIR}/WebCore/platform/efl/DefaultTheme)
  38. file(MAKE_DIRECTORY ${THEME_BINARY_DIR})
  39. add_definitions(-DDATA_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}"
  40. -DTEST_THEME_DIR="${THEME_BINARY_DIR}")
  41. set(VERSION_SCRIPT "-Wl,--version-script,${CMAKE_MODULE_PATH}/eflsymbols.filter")
  42. WEBKIT_OPTION_BEGIN()
  43. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_3D_RENDERING ON)
  44. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCESSIBILITY ON)
  45. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS ON)
  46. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BATTERY_STATUS ON)
  47. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BLOB ON)
  48. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS3_TEXT ON)
  49. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_DEVICE_ADAPTATION ON)
  50. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_IMAGE_SET ON)
  51. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_REGIONS ON)
  52. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_STICKY_POSITION ON)
  53. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_VARIABLES ON)
  54. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CUSTOM_SCHEME_HANDLER ON)
  55. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DATALIST_ELEMENT ON)
  56. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DOWNLOAD_ATTRIBUTE ON)
  57. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DRAG_SUPPORT ON)
  58. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FAST_MOBILE_SCROLLING ON)
  59. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FILTERS ON)
  60. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FULLSCREEN_API ON)
  61. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GAMEPAD ON)
  62. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INDEXED_DATABASE ON)
  63. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_COLOR ON)
  64. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LINK_PREFETCH ON)
  65. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LLINT ON)
  66. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_CAPTURE ON)
  67. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER ON)
  68. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MHTML ON)
  69. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MICRODATA ON)
  70. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MOUSE_CURSOR_SCALE ON)
  71. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NAVIGATOR_CONTENT_UTILS ON)
  72. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETSCAPE_PLUGIN_API ON)
  73. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_INFO ON)
  74. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PAGE_VISIBILITY_API ON)
  75. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOLUTION_MEDIA_QUERY ON)
  76. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REQUEST_ANIMATION_FRAME ON)
  77. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SECCOMP_FILTERS OFF)
  78. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SHARED_WORKERS ON)
  79. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPELLCHECK ON)
  80. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TEMPLATE_ELEMENT ON)
  81. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS ON)
  82. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_USERSELECT_ALL ON)
  83. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIBRATION ON)
  84. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIDEO ON)
  85. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIDEO_TRACK ON)
  86. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIEW_MODE_CSS_MEDIA ON)
  87. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_AUDIO ON)
  88. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_TIMING ON)
  89. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL ON)
  90. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_XHR_TIMEOUT ON)
  91. WEBKIT_OPTION_DEFAULT_PORT_VALUE(WTF_USE_TILED_BACKING_STORE ON)
  92. # FIXME: Perhaps we need a more generic way of defining dependencies between features.
  93. # VIDEO_TRACK depends on VIDEO.
  94. if (NOT ENABLE_VIDEO AND ENABLE_VIDEO_TRACK)
  95. message(STATUS "Disabling VIDEO_TRACK since VIDEO support is disabled.")
  96. set(ENABLE_VIDEO_TRACK OFF)
  97. endif ()
  98. WEBKIT_OPTION_END()
  99. option(ENABLE_ECORE_X "Enable Ecore_X specific usage (cursor, bell)" ON)
  100. if (ENABLE_ECORE_X)
  101. # We need Xext.h to disable Xlib error messages when running WTR on Xvfb.
  102. # These errors are dumped on stderr and makes the test driver thinks that
  103. # the test case has failed.
  104. find_package(X11 REQUIRED)
  105. list(APPEND ECORE_ADDITIONAL_COMPONENTS X)
  106. add_definitions(-DHAVE_ECORE_X)
  107. add_definitions(-DWTF_PLATFORM_X11=1)
  108. add_definitions(-DMOZ_X11)
  109. endif ()
  110. # Allow building the EFL port using EFL version 1.6+ to build on Tizen trunk
  111. find_package(Eina 1.6 REQUIRED)
  112. find_package(Evas 1.6 REQUIRED)
  113. find_package(Ecore 1.6 COMPONENTS Evas File Input Imf Imf_Evas ${ECORE_ADDITIONAL_COMPONENTS})
  114. find_package(Edje 1.6 REQUIRED)
  115. find_package(Eet 1.6 REQUIRED)
  116. find_package(Eeze 1.6 REQUIRED)
  117. find_package(Efreet 1.6 REQUIRED)
  118. find_package(E_DBus 1.6 COMPONENTS EUKit)
  119. # Add Eo dependency if EFL version is 1.8
  120. if (${EVAS_VERSION} VERSION_EQUAL 1.8 AND ${ECORE_VERSION} VERSION_EQUAL 1.8)
  121. find_package(Eo)
  122. add_definitions(-DWTF_USE_EO=1)
  123. endif ()
  124. # Prefer and promote EFL version 1.7+ as the reference configuration
  125. if ((${EINA_VERSION} STRLESS 1.7) OR (${EVAS_VERSION} STRLESS 1.7) OR (${ECORE_VERSION} STRLESS 1.7) OR (${EDJE_VERSION} STRLESS 1.7) OR
  126. (${EET_VERSION} STRLESS 1.7) OR (${EEZE_VERSION} STRLESS 1.7) OR (${EFREET_VERSION} STRLESS 1.7) OR (${E_DBUS_VERSION} STRLESS 1.7))
  127. message("Consider updating all EFL libaries to v1.7")
  128. endif ()
  129. find_package(Freetype 2.4.2 REQUIRED)
  130. find_package(HarfBuzz 0.9.2 REQUIRED)
  131. add_definitions(-DWTF_USE_FREETYPE=1)
  132. add_definitions(-DWTF_USE_HARFBUZZ=1)
  133. if (ENABLE_WEBKIT2 AND ENABLE_NETSCAPE_PLUGIN_API)
  134. set(ENABLE_PLUGIN_PROCESS 1)
  135. endif ()
  136. if (NOT ENABLE_SVG)
  137. set(ENABLE_SVG_FONTS 0)
  138. endif ()
  139. if (ENABLE_BATTERY_STATUS)
  140. find_package(DBus REQUIRED)
  141. endif ()
  142. if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
  143. set(GSTREAMER_COMPONENTS app pbutils)
  144. set(WTF_USE_GSTREAMER 1)
  145. add_definitions(-DWTF_USE_GSTREAMER=1 -DGST_API_VERSION_1=1)
  146. if (ENABLE_VIDEO)
  147. list(APPEND GSTREAMER_COMPONENTS video)
  148. endif ()
  149. if (ENABLE_WEB_AUDIO)
  150. list(APPEND GSTREAMER_COMPONENTS audio fft)
  151. add_definitions(-DWTF_USE_WEBAUDIO_GSTREAMER=1)
  152. endif ()
  153. find_package(GStreamer 1.0.5 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
  154. endif ()
  155. if (WTF_USE_TILED_BACKING_STORE)
  156. add_definitions(-DWTF_USE_ACCELERATED_COMPOSITING=1)
  157. add_definitions(-DWTF_USE_COORDINATED_GRAPHICS=1)
  158. set(WTF_USE_TEXTURE_MAPPER 1)
  159. add_definitions(-DWTF_USE_TEXTURE_MAPPER=1)
  160. set(WTF_USE_3D_GRAPHICS 1)
  161. add_definitions(-DWTF_USE_3D_GRAPHICS=1)
  162. set(ENABLE_3D_RENDERING 1)
  163. add_definitions(-DENABLE_3D_RENDERING=1)
  164. else ()
  165. # Disable 3D graphics and WEBGL if tiled backing is disabled
  166. set(ENABLE_WEBGL 0)
  167. set(WTF_USE_3D_GRAPHICS 0)
  168. add_definitions(-DWTF_USE_3D_GRAPHICS=0)
  169. endif ()
  170. if (ENABLE_WEBGL OR WTF_USE_TILED_BACKING_STORE)
  171. find_package(OpenGL REQUIRED)
  172. CHECK_INCLUDE_FILES("GL/glx.h" OPENGLX_FOUND)
  173. if (OPENGLX_FOUND)
  174. add_definitions(-DHAVE_GLX)
  175. endif ()
  176. option(ENABLE_EGL ON)
  177. if (ENABLE_EGL)
  178. find_package(EGL REQUIRED)
  179. endif ()
  180. if (EGL_FOUND)
  181. set(WTF_USE_EGL 1)
  182. set(USE_GRAPHICS_SURFACE 1)
  183. add_definitions(-DWTF_USE_EGL=1)
  184. option(ENABLE_GLES2 ON)
  185. if (ENABLE_GLES2)
  186. find_package(GLES REQUIRED)
  187. endif ()
  188. if (OPENGLES2_FOUND)
  189. set(WTF_USE_OPENGL_ES_2 1)
  190. add_definitions(-DWTF_USE_OPENGL_ES_2=1)
  191. endif ()
  192. elseif (OPENGLX_FOUND)
  193. add_definitions(-DWTF_USE_GLX=1)
  194. if (X11_Xcomposite_FOUND AND X11_Xrender_FOUND)
  195. set(USE_GRAPHICS_SURFACE 1)
  196. elseif (ENABLE_WEBGL)
  197. # FIXME: Add support for NOT X11_Xcomposite for GLX
  198. message(FATAL_ERROR "To use WebGL with GLX support requires X11_Xcomposite.")
  199. endif ()
  200. endif ()
  201. endif ()
  202. if (ENABLE_INSPECTOR)
  203. set(WEB_INSPECTOR_DIR "${DATA_INSTALL_DIR}/inspector")
  204. add_definitions(-DWEB_INSPECTOR_DIR=\"${CMAKE_BINARY_DIR}/${WEB_INSPECTOR_DIR}\")
  205. add_definitions(-DWEB_INSPECTOR_INSTALL_DIR=\"${CMAKE_INSTALL_PREFIX}/${WEB_INSPECTOR_DIR}\")
  206. endif ()
  207. if (ENABLE_SECCOMP_FILTERS)
  208. find_package(LibSeccomp REQUIRED)
  209. endif ()
  210. set(CPACK_SOURCE_GENERATOR TBZ2)
  211. # Optimize binary size for release builds by removing dead sections on unix/gcc
  212. if (CMAKE_COMPILER_IS_GNUCC AND UNIX AND NOT APPLE)
  213. set(CMAKE_C_FLAGS_RELEASE "-ffunction-sections -fdata-sections ${CMAKE_C_FLAGS_RELEASE}")
  214. set(CMAKE_CXX_FLAGS_RELEASE "-ffunction-sections -fdata-sections ${CMAKE_CXX_FLAGS_RELEASE}")
  215. set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,--gc-sections ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
  216. endif ()
  217. if (ENABLE_WEBGL)
  218. set(ENABLE_WEBGL 1)
  219. if (USE_GRAPHICS_SURFACE)
  220. add_definitions(-DWTF_USE_GRAPHICS_SURFACE=1)
  221. endif ()
  222. endif ()
  223. if (ENABLE_SPELLCHECK)
  224. find_package(Enchant REQUIRED)
  225. endif ()
  226. if (ENABLE_ACCESSIBILITY)
  227. find_package(ATK 2.8.0 REQUIRED)
  228. else ()
  229. add_definitions(-DHAVE_ACCESSIBILITY=0)
  230. endif ()
  231. if (ENABLE_INDEXED_DATABASE)
  232. set(WTF_USE_LEVELDB 1)
  233. add_definitions(-DWTF_USE_LEVELDB=1)
  234. endif ()