[WPE] Enable WOFF2 support
[WebKit-https.git] / Source / cmake / OptionsWPE.cmake
1 include(GNUInstallDirs)
2 include(VersioningUtils)
3
4 SET_PROJECT_VERSION(0 19 0)
5 set(WPE_API_VERSION 0.1)
6
7 CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT 1 0 0)
8
9 WEBKIT_OPTION_BEGIN()
10
11 include(GStreamerDefinitions)
12
13 # Public options shared with other WebKit ports. Do not add any options here
14 # without approval from a WPE reviewer. There must be strong reason to support
15 # changing the value of the option.
16 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS PUBLIC OFF)
17 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ENCRYPTED_MEDIA PUBLIC ${ENABLE_EXPERIMENTAL_FEATURES})
18 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_JIT PUBLIC ON)
19 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBDRIVER PUBLIC ON)
20 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_CRYPTO PUBLIC ON)
21 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_XSLT PUBLIC ON)
22 WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SYSTEM_MALLOC PUBLIC OFF)
23
24 # Private options shared with other WebKit ports. Add options here only if
25 # we need a value different from the default defined in WebKitFeatures.cmake.
26 # Changing these options is completely unsupported.
27 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCESSIBILITY PRIVATE ON)
28 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FULLSCREEN_API PRIVATE OFF)
29 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PRIVATE OFF)
30 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MHTML PRIVATE ON)
31 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETSCAPE_PLUGIN_API PRIVATE OFF)
32 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NOTIFICATIONS PRIVATE OFF)
33 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SERVICE_WORKER PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
34 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SMOOTH_SCROLLING PRIVATE OFF)
35 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS PRIVATE ON)
36 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL2 PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
37
38 # Public options specific to the WPE port. Do not add any options here unless
39 # there is a strong reason we should support changing the value of the option,
40 # and the option is not relevant to any other WebKit ports.
41 WEBKIT_OPTION_DEFINE(USE_WOFF2 "Whether to enable support for WOFF2 Web Fonts." PUBLIC ON)
42
43 # Private options specific to the WPE port.
44 WEBKIT_OPTION_DEFINE(USE_OPENVR "Whether to use OpenVR as WebVR backend." PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
45
46 if (CMAKE_SYSTEM_NAME MATCHES "Linux")
47     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE ON)
48     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOURCE_USAGE PRIVATE ON)
49 else ()
50     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE OFF)
51     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOURCE_USAGE PRIVATE OFF)
52 endif ()
53
54 SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE})
55 if (DEVELOPER_MODE)
56     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS PRIVATE ON)
57 endif ()
58
59 include(GStreamerDependencies)
60
61 WEBKIT_OPTION_END()
62
63 find_package(Cairo 1.10.2 REQUIRED)
64 find_package(Fontconfig 2.8.0 REQUIRED)
65 find_package(Freetype2 2.4.2 REQUIRED)
66 find_package(GLIB 2.40.0 REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule)
67 find_package(HarfBuzz 0.9.18 REQUIRED)
68 find_package(ICU REQUIRED)
69 find_package(JPEG REQUIRED)
70 find_package(LibEpoxy 1.4.0 REQUIRED)
71 find_package(LibGcrypt 1.6.0 REQUIRED)
72 find_package(LibSoup 2.42.0 REQUIRED)
73 find_package(LibXml2 2.8.0 REQUIRED)
74 find_package(PNG REQUIRED)
75 find_package(Sqlite REQUIRED)
76 find_package(Threads REQUIRED)
77 find_package(WebP REQUIRED)
78 find_package(WPEBackend REQUIRED)
79 find_package(ZLIB REQUIRED)
80
81 if (USE_WOFF2)
82     find_package(WOFF2Dec 1.0.2)
83     if (NOT WOFF2DEC_FOUND)
84         message(FATAL_ERROR "liwoff2dec is needed for USE_WOFF2.")
85     endif ()
86 endif ()
87
88 if (ENABLE_ACCELERATED_2D_CANVAS)
89     find_package(CairoGL 1.10.2 REQUIRED COMPONENTS cairo-egl)
90 endif ()
91
92 if (ENABLE_SUBTLE_CRYPTO)
93     find_package(Libtasn1 REQUIRED)
94     if (NOT LIBTASN1_FOUND)
95         message(FATAL_ERROR "libtasn1 is required to enable Web Crypto API support.")
96     endif ()
97     if (LIBGCRYPT_VERSION VERSION_LESS 1.7.0)
98         message(FATAL_ERROR "libgcrypt 1.7.0 is required to enable Web Crypto API support.")
99     endif ()
100 endif ()
101
102 if (ENABLE_XSLT)
103     find_package(LibXslt 1.1.7 REQUIRED)
104 endif ()
105
106 add_definitions(-DBUILDING_WPE__=1)
107 add_definitions(-DGETTEXT_PACKAGE="WPE")
108 add_definitions(-DDATA_DIR="${CMAKE_INSTALL_DATADIR}")
109 add_definitions(-DJSC_GLIB_API_ENABLED)
110
111 SET_AND_EXPOSE_TO_BUILD(USE_CAIRO TRUE)
112 SET_AND_EXPOSE_TO_BUILD(USE_EGL TRUE)
113 SET_AND_EXPOSE_TO_BUILD(USE_GCRYPT TRUE)
114 SET_AND_EXPOSE_TO_BUILD(USE_LIBEPOXY TRUE)
115 SET_AND_EXPOSE_TO_BUILD(USE_OPENGL_ES TRUE)
116 SET_AND_EXPOSE_TO_BUILD(USE_XDGMIME TRUE)
117
118 SET_AND_EXPOSE_TO_BUILD(ENABLE_GRAPHICS_CONTEXT_3D TRUE)
119
120 SET_AND_EXPOSE_TO_BUILD(USE_TEXTURE_MAPPER TRUE)
121 SET_AND_EXPOSE_TO_BUILD(USE_TEXTURE_MAPPER_GL TRUE)
122 SET_AND_EXPOSE_TO_BUILD(USE_TILED_BACKING_STORE TRUE)
123 SET_AND_EXPOSE_TO_BUILD(USE_COORDINATED_GRAPHICS TRUE)
124 SET_AND_EXPOSE_TO_BUILD(USE_COORDINATED_GRAPHICS_THREADED TRUE)
125
126 set(FORWARDING_HEADERS_DIR ${DERIVED_SOURCES_DIR}/ForwardingHeaders)
127 set(FORWARDING_HEADERS_WPE_DIR ${FORWARDING_HEADERS_DIR}/wpe)
128 set(FORWARDING_HEADERS_WPE_EXTENSION_DIR ${FORWARDING_HEADERS_DIR}/wpe-webextension)
129 set(DERIVED_SOURCES_JAVASCRIPCOREWPE_DIR ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/javascriptcorewpe)
130 set(DERIVED_SOURCES_JAVASCRIPCORE_GLIB_API_DIR ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/javascriptcorewpe/jsc)
131 set(DERIVED_SOURCES_WPE_API_DIR ${DERIVED_SOURCES_WEBKIT_DIR}/wpe)
132
133 include(GStreamerChecks)