9745336bd4fd9ee52e45f102d7a302ee78d57752
[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 # Private options specific to the WPE port.
39 WEBKIT_OPTION_DEFINE(USE_OPENVR "Whether to use OpenVR as WebVR backend." PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
40
41 if (CMAKE_SYSTEM_NAME MATCHES "Linux")
42     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE ON)
43     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOURCE_USAGE PRIVATE ON)
44 else ()
45     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE OFF)
46     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOURCE_USAGE PRIVATE OFF)
47 endif ()
48
49 SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE})
50 if (DEVELOPER_MODE)
51     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS PRIVATE ON)
52 endif ()
53
54 include(GStreamerDependencies)
55
56 WEBKIT_OPTION_END()
57
58 find_package(Cairo 1.10.2 REQUIRED)
59 find_package(Fontconfig 2.8.0 REQUIRED)
60 find_package(Freetype2 2.4.2 REQUIRED)
61 find_package(GLIB 2.40.0 REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule)
62 find_package(HarfBuzz 0.9.18 REQUIRED)
63 find_package(ICU REQUIRED)
64 find_package(JPEG REQUIRED)
65 find_package(LibEpoxy 1.4.0 REQUIRED)
66 find_package(LibGcrypt 1.6.0 REQUIRED)
67 find_package(LibSoup 2.42.0 REQUIRED)
68 find_package(LibXml2 2.8.0 REQUIRED)
69 find_package(PNG REQUIRED)
70 find_package(Sqlite REQUIRED)
71 find_package(Threads REQUIRED)
72 find_package(WebP REQUIRED)
73 find_package(WPEBackend REQUIRED)
74 find_package(ZLIB REQUIRED)
75
76 if (ENABLE_ACCELERATED_2D_CANVAS)
77     find_package(CairoGL 1.10.2 REQUIRED COMPONENTS cairo-egl)
78 endif ()
79
80 if (ENABLE_SUBTLE_CRYPTO)
81     find_package(Libtasn1 REQUIRED)
82     if (NOT LIBTASN1_FOUND)
83         message(FATAL_ERROR "libtasn1 is required to enable Web Crypto API support.")
84     endif ()
85     if (LIBGCRYPT_VERSION VERSION_LESS 1.7.0)
86         message(FATAL_ERROR "libgcrypt 1.7.0 is required to enable Web Crypto API support.")
87     endif ()
88 endif ()
89
90 if (ENABLE_XSLT)
91     find_package(LibXslt 1.1.7 REQUIRED)
92 endif ()
93
94 add_definitions(-DBUILDING_WPE__=1)
95 add_definitions(-DGETTEXT_PACKAGE="WPE")
96 add_definitions(-DDATA_DIR="${CMAKE_INSTALL_DATADIR}")
97 add_definitions(-DJSC_GLIB_API_ENABLED)
98
99 SET_AND_EXPOSE_TO_BUILD(USE_CAIRO TRUE)
100 SET_AND_EXPOSE_TO_BUILD(USE_EGL TRUE)
101 SET_AND_EXPOSE_TO_BUILD(USE_GCRYPT TRUE)
102 SET_AND_EXPOSE_TO_BUILD(USE_LIBEPOXY TRUE)
103 SET_AND_EXPOSE_TO_BUILD(USE_OPENGL_ES TRUE)
104 SET_AND_EXPOSE_TO_BUILD(USE_XDGMIME TRUE)
105
106 SET_AND_EXPOSE_TO_BUILD(ENABLE_GRAPHICS_CONTEXT_3D TRUE)
107
108 SET_AND_EXPOSE_TO_BUILD(USE_TEXTURE_MAPPER TRUE)
109 SET_AND_EXPOSE_TO_BUILD(USE_TEXTURE_MAPPER_GL TRUE)
110 SET_AND_EXPOSE_TO_BUILD(USE_TILED_BACKING_STORE TRUE)
111 SET_AND_EXPOSE_TO_BUILD(USE_COORDINATED_GRAPHICS TRUE)
112 SET_AND_EXPOSE_TO_BUILD(USE_COORDINATED_GRAPHICS_THREADED TRUE)
113
114 set(FORWARDING_HEADERS_DIR ${DERIVED_SOURCES_DIR}/ForwardingHeaders)
115 set(FORWARDING_HEADERS_WPE_DIR ${FORWARDING_HEADERS_DIR}/wpe)
116 set(FORWARDING_HEADERS_WPE_EXTENSION_DIR ${FORWARDING_HEADERS_DIR}/wpe-webextension)
117 set(DERIVED_SOURCES_JAVASCRIPCOREWPE_DIR ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/javascriptcorewpe)
118 set(DERIVED_SOURCES_JAVASCRIPCORE_GLIB_API_DIR ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/javascriptcorewpe/jsc)
119 set(DERIVED_SOURCES_WPE_API_DIR ${DERIVED_SOURCES_WEBKIT_DIR}/wpe)
120
121 include(GStreamerChecks)