[WK2] Gather resource load statistics
[WebKit-https.git] / Source / WebKit2 / PlatformGTK.cmake
1 set(WebKit2_OUTPUT_NAME webkit2gtk-${WEBKITGTK_API_VERSION})
2 set(WebKit2_WebProcess_OUTPUT_NAME WebKitWebProcess)
3 set(WebKit2_NetworkProcess_OUTPUT_NAME WebKitNetworkProcess)
4 set(WebKit2_PluginProcess_OUTPUT_NAME WebKitPluginProcess)
5 set(WebKit2_DatabaseProcess_OUTPUT_NAME WebKitDatabaseProcess)
6
7 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBKIT2_DIR})
8 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR})
9 file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WEBKIT2GTK_DIR})
10 file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR})
11
12 configure_file(UIProcess/API/gtk/WebKitVersion.h.in ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitVersion.h)
13 configure_file(webkit2gtk.pc.in ${WebKit2_PKGCONFIG_FILE} @ONLY)
14 configure_file(webkit2gtk-web-extension.pc.in ${WebKit2WebExtension_PKGCONFIG_FILE} @ONLY)
15
16 add_definitions(-DBUILDING_WEBKIT)
17 add_definitions(-DWEBKIT2_COMPILATION)
18
19 add_definitions(-DLIBEXECDIR="${CMAKE_INSTALL_FULL_LIBEXECDIR}")
20 add_definitions(-DPKGLIBEXECDIR="${LIBEXEC_INSTALL_DIR}")
21 add_definitions(-DLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
22 add_definitions(-DLIBDIR="${LIB_INSTALL_DIR}")
23 add_definitions(-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}")
24
25 set(WebKit2_USE_PREFIX_HEADER ON)
26
27 list(APPEND WebKit2_SOURCES
28     DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp
29
30     NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.cpp
31     NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp
32
33     NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp
34
35     NetworkProcess/Downloads/soup/DownloadSoup.cpp
36
37     NetworkProcess/cache/NetworkCacheDataSoup.cpp
38     NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp
39
40     NetworkProcess/gtk/NetworkProcessMainGtk.cpp
41
42     NetworkProcess/soup/NetworkProcessSoup.cpp
43     NetworkProcess/soup/RemoteNetworkingContextSoup.cpp
44
45     Platform/IPC/glib/GSocketMonitor.cpp
46     Platform/IPC/unix/AttachmentUnix.cpp
47     Platform/IPC/unix/ConnectionUnix.cpp
48
49     Platform/gtk/LoggingGtk.cpp
50     Platform/gtk/ModuleGtk.cpp
51
52     Platform/unix/SharedMemoryUnix.cpp
53
54     PluginProcess/unix/PluginControllerProxyUnix.cpp
55     PluginProcess/unix/PluginProcessMainUnix.cpp
56     PluginProcess/unix/PluginProcessUnix.cpp
57
58     Shared/API/c/cairo/WKImageCairo.cpp
59
60     Shared/Authentication/soup/AuthenticationManagerSoup.cpp
61
62     Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
63
64     Shared/Plugins/unix/PluginSearchPath.cpp
65
66     Shared/cairo/ShareableBitmapCairo.cpp
67
68     Shared/gtk/ArgumentCodersGtk.cpp
69     Shared/gtk/NativeWebKeyboardEventGtk.cpp
70     Shared/gtk/NativeWebMouseEventGtk.cpp
71     Shared/gtk/NativeWebTouchEventGtk.cpp
72     Shared/gtk/NativeWebWheelEventGtk.cpp
73     Shared/gtk/PrintInfoGtk.cpp
74     Shared/gtk/ProcessExecutablePathGtk.cpp
75     Shared/gtk/WebContextMenuItemGtk.cpp
76     Shared/gtk/WebEventFactory.cpp
77
78     Shared/linux/WebMemorySamplerLinux.cpp
79
80     Shared/linux/SeccompFilters/OpenSyscall.cpp
81     Shared/linux/SeccompFilters/SeccompBroker.cpp
82     Shared/linux/SeccompFilters/SeccompFilters.cpp
83     Shared/linux/SeccompFilters/SigactionSyscall.cpp
84     Shared/linux/SeccompFilters/SigprocmaskSyscall.cpp
85     Shared/linux/SeccompFilters/Syscall.cpp
86     Shared/linux/SeccompFilters/SyscallPolicy.cpp
87     Shared/linux/SeccompFilters/XDGBaseDirectoryGLib.cpp
88
89     Shared/soup/WebCoreArgumentCodersSoup.cpp
90
91     Shared/unix/ChildProcessMain.cpp
92
93     UIProcess/BackingStore.cpp
94     UIProcess/DefaultUndoController.cpp
95     UIProcess/DrawingAreaProxyImpl.cpp
96     UIProcess/LegacySessionStateCodingNone.cpp
97     UIProcess/WebResourceLoadStatisticsStore.cpp
98
99     UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp
100
101     UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp
102     UIProcess/API/C/gtk/WKInspectorClientGtk.cpp
103     UIProcess/API/C/gtk/WKTextCheckerGtk.cpp
104     UIProcess/API/C/gtk/WKView.cpp
105
106     UIProcess/API/C/soup/WKCookieManagerSoup.cpp
107     UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp
108
109     UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp
110     UIProcess/API/gtk/PageClientImpl.cpp
111     UIProcess/API/gtk/PageClientImpl.h
112     UIProcess/API/gtk/WebKitAuthenticationDialog.cpp
113     UIProcess/API/gtk/WebKitAuthenticationDialog.h
114     UIProcess/API/gtk/WebKitAuthenticationRequest.cpp
115     UIProcess/API/gtk/WebKitAuthenticationRequest.h
116     UIProcess/API/gtk/WebKitAutocleanups.h
117     UIProcess/API/gtk/WebKitBackForwardList.cpp
118     UIProcess/API/gtk/WebKitBackForwardList.h
119     UIProcess/API/gtk/WebKitBackForwardListItem.cpp
120     UIProcess/API/gtk/WebKitBackForwardListItem.h
121     UIProcess/API/gtk/WebKitBackForwardListPrivate.h
122     UIProcess/API/gtk/WebKitColorChooser.cpp
123     UIProcess/API/gtk/WebKitColorChooserRequest.cpp
124     UIProcess/API/gtk/WebKitContextMenu.cpp
125     UIProcess/API/gtk/WebKitContextMenu.h
126     UIProcess/API/gtk/WebKitContextMenuActions.cpp
127     UIProcess/API/gtk/WebKitContextMenuActions.h
128     UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h
129     UIProcess/API/gtk/WebKitContextMenuClient.cpp
130     UIProcess/API/gtk/WebKitContextMenuClient.h
131     UIProcess/API/gtk/WebKitContextMenuItem.cpp
132     UIProcess/API/gtk/WebKitContextMenuItem.h
133     UIProcess/API/gtk/WebKitContextMenuItemPrivate.h
134     UIProcess/API/gtk/WebKitContextMenuPrivate.h
135     UIProcess/API/gtk/WebKitCookieManager.cpp
136     UIProcess/API/gtk/WebKitCookieManager.h
137     UIProcess/API/gtk/WebKitCookieManagerPrivate.h
138     UIProcess/API/gtk/WebKitCredential.cpp
139     UIProcess/API/gtk/WebKitCredential.h
140     UIProcess/API/gtk/WebKitDefines.h
141     UIProcess/API/gtk/WebKitDownload.cpp
142     UIProcess/API/gtk/WebKitDownload.h
143     UIProcess/API/gtk/WebKitDownloadClient.cpp
144     UIProcess/API/gtk/WebKitDownloadClient.h
145     UIProcess/API/gtk/WebKitDownloadPrivate.h
146     UIProcess/API/gtk/WebKitEditingCommands.h
147     UIProcess/API/gtk/WebKitEditorState.cpp
148     UIProcess/API/gtk/WebKitError.cpp
149     UIProcess/API/gtk/WebKitError.h
150     UIProcess/API/gtk/WebKitFaviconDatabase.cpp
151     UIProcess/API/gtk/WebKitFaviconDatabase.h
152     UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h
153     UIProcess/API/gtk/WebKitFileChooserRequest.cpp
154     UIProcess/API/gtk/WebKitFileChooserRequest.h
155     UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h
156     UIProcess/API/gtk/WebKitFindController.cpp
157     UIProcess/API/gtk/WebKitFindController.h
158     UIProcess/API/gtk/WebKitFormClient.cpp
159     UIProcess/API/gtk/WebKitFormClient.h
160     UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp
161     UIProcess/API/gtk/WebKitFormSubmissionRequest.h
162     UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h
163     UIProcess/API/gtk/WebKitForwardDeclarations.h
164     UIProcess/API/gtk/WebKitFullscreenClient.cpp
165     UIProcess/API/gtk/WebKitFullscreenClient.h
166     UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp
167     UIProcess/API/gtk/WebKitGeolocationPermissionRequest.h
168     UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h
169     UIProcess/API/gtk/WebKitGeolocationProvider.cpp
170     UIProcess/API/gtk/WebKitGeolocationProvider.h
171     UIProcess/API/gtk/WebKitHitTestResult.cpp
172     UIProcess/API/gtk/WebKitHitTestResult.h
173     UIProcess/API/gtk/WebKitHitTestResultPrivate.h
174     UIProcess/API/gtk/WebKitInjectedBundleClient.cpp
175     UIProcess/API/gtk/WebKitInjectedBundleClient.h
176     UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp
177     UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.h
178     UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h
179     UIProcess/API/gtk/WebKitJavascriptResult.cpp
180     UIProcess/API/gtk/WebKitJavascriptResult.h
181     UIProcess/API/gtk/WebKitJavascriptResultPrivate.h
182     UIProcess/API/gtk/WebKitLoaderClient.cpp
183     UIProcess/API/gtk/WebKitLoaderClient.h
184     UIProcess/API/gtk/WebKitMimeInfo.cpp
185     UIProcess/API/gtk/WebKitMimeInfo.h
186     UIProcess/API/gtk/WebKitMimeInfoPrivate.h
187     UIProcess/API/gtk/WebKitNavigationAction.cpp
188     UIProcess/API/gtk/WebKitNavigationAction.h
189     UIProcess/API/gtk/WebKitNavigationActionPrivate.h
190     UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp
191     UIProcess/API/gtk/WebKitNavigationPolicyDecision.h
192     UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h
193     UIProcess/API/gtk/WebKitNotification.cpp
194     UIProcess/API/gtk/WebKitNotification.h
195     UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp
196     UIProcess/API/gtk/WebKitNotificationPermissionRequest.h
197     UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h
198     UIProcess/API/gtk/WebKitNotificationPrivate.h
199     UIProcess/API/gtk/WebKitNotificationProvider.cpp
200     UIProcess/API/gtk/WebKitNotificationProvider.h
201     UIProcess/API/gtk/WebKitPermissionRequest.cpp
202     UIProcess/API/gtk/WebKitPermissionRequest.h
203     UIProcess/API/gtk/WebKitPlugin.cpp
204     UIProcess/API/gtk/WebKitPlugin.h
205     UIProcess/API/gtk/WebKitPluginPrivate.h
206     UIProcess/API/gtk/WebKitPolicyClient.cpp
207     UIProcess/API/gtk/WebKitPolicyClient.h
208     UIProcess/API/gtk/WebKitPolicyDecision.cpp
209     UIProcess/API/gtk/WebKitPolicyDecision.h
210     UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h
211     UIProcess/API/gtk/WebKitPrintOperation.cpp
212     UIProcess/API/gtk/WebKitPrintOperation.h
213     UIProcess/API/gtk/WebKitPrintOperationPrivate.h
214     UIProcess/API/gtk/WebKitPrivate.cpp
215     UIProcess/API/gtk/WebKitPrivate.h
216     UIProcess/API/gtk/WebKitRequestManagerClient.cpp
217     UIProcess/API/gtk/WebKitRequestManagerClient.h
218     UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp
219     UIProcess/API/gtk/WebKitResponsePolicyDecision.h
220     UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h
221     UIProcess/API/gtk/WebKitScriptDialog.cpp
222     UIProcess/API/gtk/WebKitScriptDialog.h
223     UIProcess/API/gtk/WebKitScriptDialogPrivate.h
224     UIProcess/API/gtk/WebKitSecurityManager.cpp
225     UIProcess/API/gtk/WebKitSecurityManager.h
226     UIProcess/API/gtk/WebKitSecurityManagerPrivate.h
227     UIProcess/API/gtk/WebKitSettings.cpp
228     UIProcess/API/gtk/WebKitSettings.h
229     UIProcess/API/gtk/WebKitSettingsPrivate.h
230     UIProcess/API/gtk/WebKitUIClient.cpp
231     UIProcess/API/gtk/WebKitUIClient.h
232     UIProcess/API/gtk/WebKitURIRequest.cpp
233     UIProcess/API/gtk/WebKitURIRequest.h
234     UIProcess/API/gtk/WebKitURIRequestPrivate.h
235     UIProcess/API/gtk/WebKitURIResponse.cpp
236     UIProcess/API/gtk/WebKitURIResponse.h
237     UIProcess/API/gtk/WebKitURIResponsePrivate.h
238     UIProcess/API/gtk/WebKitURISchemeRequest.cpp
239     UIProcess/API/gtk/WebKitURISchemeRequest.h
240     UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h
241     UIProcess/API/gtk/WebKitUserContent.cpp
242     UIProcess/API/gtk/WebKitUserContent.h
243     UIProcess/API/gtk/WebKitUserContentManager.cpp
244     UIProcess/API/gtk/WebKitUserContentManager.h
245     UIProcess/API/gtk/WebKitUserContentManagerPrivate.h
246     UIProcess/API/gtk/WebKitUserContentPrivate.h
247     UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp
248     UIProcess/API/gtk/WebKitUserMediaPermissionRequest.h
249     UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h
250     UIProcess/API/gtk/WebKitVersion.cpp
251     UIProcess/API/gtk/WebKitVersion.h.in
252     UIProcess/API/gtk/WebKitWebContext.cpp
253     UIProcess/API/gtk/WebKitWebContext.h
254     UIProcess/API/gtk/WebKitWebContextPrivate.h
255     UIProcess/API/gtk/WebKitWebInspector.cpp
256     UIProcess/API/gtk/WebKitWebInspector.h
257     UIProcess/API/gtk/WebKitWebInspectorPrivate.h
258     UIProcess/API/gtk/WebKitWebResource.cpp
259     UIProcess/API/gtk/WebKitWebResource.h
260     UIProcess/API/gtk/WebKitWebResourcePrivate.h
261     UIProcess/API/gtk/WebKitWebView.cpp
262     UIProcess/API/gtk/WebKitWebView.h
263     UIProcess/API/gtk/WebKitWebViewBase.cpp
264     UIProcess/API/gtk/WebKitWebViewBase.h
265     UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp
266     UIProcess/API/gtk/WebKitWebViewBaseAccessible.h
267     UIProcess/API/gtk/WebKitWebViewBasePrivate.h
268     UIProcess/API/gtk/WebKitWebViewPrivate.h
269     UIProcess/API/gtk/WebKitWebViewSessionState.cpp
270     UIProcess/API/gtk/WebKitWebViewSessionState.h
271     UIProcess/API/gtk/WebKitWebViewSessionStatePrivate.h
272     UIProcess/API/gtk/WebKitWebsiteDataManager.cpp
273     UIProcess/API/gtk/WebKitWebsiteDataManager.h
274     UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h
275     UIProcess/API/gtk/WebKitWindowProperties.cpp
276     UIProcess/API/gtk/WebKitWindowProperties.h
277     UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h
278     UIProcess/API/gtk/webkit2.h
279
280     UIProcess/Databases/gtk/DatabaseProcessProxyGtk.cpp
281
282     UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp
283
284     UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp
285
286     UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
287
288     UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp
289     UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp
290     UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp
291
292     UIProcess/Network/soup/NetworkProcessProxySoup.cpp
293
294     UIProcess/Plugins/gtk/PluginInfoCache.cpp
295
296     UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
297     UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
298
299     UIProcess/Storage/StorageManager.cpp
300
301     UIProcess/WebsiteData/unix/WebsiteDataStoreUnix.cpp
302
303     UIProcess/cairo/BackingStoreCairo.cpp
304
305     UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.cpp
306     UIProcess/gstreamer/WebPageProxyGStreamer.cpp
307
308     UIProcess/gtk/DragAndDropHandler.cpp
309     UIProcess/gtk/ExperimentalFeatures.cpp
310     UIProcess/gtk/GestureController.cpp
311     UIProcess/gtk/InputMethodFilter.cpp
312     UIProcess/gtk/KeyBindingTranslator.cpp
313     UIProcess/gtk/RedirectedXCompositeWindow.cpp
314     UIProcess/gtk/TextCheckerGtk.cpp
315     UIProcess/gtk/WebColorPickerGtk.cpp
316     UIProcess/gtk/WebContextMenuProxyGtk.cpp
317     UIProcess/gtk/WebFullScreenClientGtk.cpp
318     UIProcess/gtk/WebInspectorClientGtk.cpp
319     UIProcess/gtk/WebInspectorProxyGtk.cpp
320     UIProcess/gtk/WebPageProxyGtk.cpp
321     UIProcess/gtk/WebPopupMenuProxyGtk.cpp
322     UIProcess/gtk/WebPreferencesGtk.cpp
323     UIProcess/gtk/WebProcessPoolGtk.cpp
324     UIProcess/gtk/WebProcessProxyGtk.cpp
325
326     UIProcess/soup/WebCookieManagerProxySoup.cpp
327     UIProcess/soup/WebProcessPoolSoup.cpp
328
329     WebProcess/Cookies/soup/WebCookieManagerSoup.cpp
330     WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp
331
332     WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp
333     WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp
334     WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp
335     WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp
336     WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp
337     WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp
338     WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp
339
340     WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp
341
342     WebProcess/MediaCache/WebMediaKeyStorageManager.cpp
343
344     WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp
345     WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp
346
347     WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
348
349     WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp
350     WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp
351     WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
352     WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp
353     WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp
354
355     WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp
356
357     WebProcess/WebPage/DrawingAreaImpl.cpp
358
359     WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp
360
361     WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp
362
363     WebProcess/WebPage/gtk/PrinterListGtk.cpp
364     WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp
365     WebProcess/WebPage/gtk/WebPageGtk.cpp
366     WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
367
368     WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp
369     WebProcess/gtk/SeccompFiltersWebProcessGtk.h
370     WebProcess/gtk/WebGtkExtensionManager.cpp
371     WebProcess/gtk/WebGtkInjectedBundleMain.cpp
372     WebProcess/gtk/WebProcessMainGtk.cpp
373
374     WebProcess/soup/WebKitSoupRequestInputStream.cpp
375     WebProcess/soup/WebProcessSoup.cpp
376 )
377
378 list(APPEND WebKit2_DERIVED_SOURCES
379     ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
380     ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c
381     ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.c
382
383     ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.cpp
384     ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
385 )
386
387 set(WebKit2GTK_INSTALLED_HEADERS
388     ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.h
389     ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitVersion.h
390     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitAuthenticationRequest.h
391     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitAutocleanups.h
392     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitBackForwardList.h
393     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitBackForwardListItem.h
394     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitColorChooserRequest.h
395     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitCredential.h
396     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenu.h
397     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuActions.h
398     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuItem.h
399     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitCookieManager.h
400     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitDefines.h
401     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitDownload.h
402     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitEditingCommands.h
403     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitEditorState.h
404     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitError.h
405     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitFaviconDatabase.h
406     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitFileChooserRequest.h
407     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitFindController.h
408     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitFormSubmissionRequest.h
409     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitForwardDeclarations.h
410     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.h
411     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitHitTestResult.h
412     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.h
413     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitJavascriptResult.h
414     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitMimeInfo.h
415     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNavigationAction.h
416     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h
417     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNotificationPermissionRequest.h
418     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNotification.h
419     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPermissionRequest.h
420     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPlugin.h
421     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPolicyDecision.h
422     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPrintOperation.h
423     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitResponsePolicyDecision.h
424     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitScriptDialog.h
425     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitSecurityManager.h
426     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitSettings.h
427     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURIRequest.h
428     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURIResponse.h
429     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURISchemeRequest.h
430     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitUserContent.h
431     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitUserContentManager.h
432     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitUserMediaPermissionRequest.h
433     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebContext.h
434     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebInspector.h
435     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebResource.h
436     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebView.h
437     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebViewBase.h
438     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebViewSessionState.h
439     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWebsiteDataManager.h
440     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitWindowProperties.h
441     ${WEBKIT2_DIR}/UIProcess/API/gtk/webkit2.h
442 )
443
444 set(WebKit2WebExtension_INSTALLED_HEADERS
445     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.h
446     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitFrame.h
447     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.h
448     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h
449     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h
450     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h
451     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.h
452     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h
453     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h
454 )
455
456 set(InspectorFiles
457     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.html
458     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Base/*.js
459     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.css
460     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.js
461     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.css
462     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.js
463     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.css
464     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.js
465     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/ESLint/*.js
466     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/Esprima/*.js
467     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Models/*.js
468     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Protocol/*.js
469     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Test/*.js
470     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.css
471     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.js
472     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.png
473     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.svg
474     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
475 )
476
477 file(GLOB InspectorFilesDependencies
478     ${InspectorFiles}
479 )
480
481 # DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
482 # expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
483 add_custom_command(
484     OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
485     DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
486     COMMAND cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
487 )
488
489 # This is necessary because of a conflict between the GTK+ API WebKitVersion.h and one generated by WebCore.
490 list(INSERT WebKit2_INCLUDE_DIRECTORIES 0
491     "${FORWARDING_HEADERS_WEBKIT2GTK_DIR}"
492     "${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}"
493     "${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}"
494     "${DERIVED_SOURCES_WEBKIT2GTK_DIR}"
495 )
496
497 list(APPEND WebKit2_INCLUDE_DIRECTORIES
498     "${WEBKIT2_DIR}/PluginProcess/unix"
499     "${WEBCORE_DIR}/platform/cairo"
500     "${WEBCORE_DIR}/platform/gtk"
501     "${WEBCORE_DIR}/platform/graphics/cairo"
502     "${WEBCORE_DIR}/platform/graphics/opentype"
503     "${WEBCORE_DIR}/platform/graphics/x11"
504     "${WEBCORE_DIR}/platform/network/soup"
505     "${WEBCORE_DIR}/platform/text/enchant"
506     "${WEBKIT2_DIR}/DatabaseProcess/unix"
507     "${WEBKIT2_DIR}/NetworkProcess/CustomProtocols/soup"
508     "${WEBKIT2_DIR}/NetworkProcess/Downloads/soup"
509     "${WEBKIT2_DIR}/NetworkProcess/gtk"
510     "${WEBKIT2_DIR}/NetworkProcess/unix"
511     "${WEBKIT2_DIR}/Platform/IPC/glib"
512     "${WEBKIT2_DIR}/Shared/API/c/gtk"
513     "${WEBKIT2_DIR}/Shared/Plugins/unix"
514     "${WEBKIT2_DIR}/Shared/glib"
515     "${WEBKIT2_DIR}/Shared/gtk"
516     "${WEBKIT2_DIR}/Shared/linux"
517     "${WEBKIT2_DIR}/Shared/linux/SeccompFilters"
518     "${WEBKIT2_DIR}/Shared/soup"
519     "${WEBKIT2_DIR}/Shared/unix"
520     "${WEBKIT2_DIR}/UIProcess/API/C/cairo"
521     "${WEBKIT2_DIR}/UIProcess/API/C/gtk"
522     "${WEBKIT2_DIR}/UIProcess/API/C/soup"
523     "${WEBKIT2_DIR}/UIProcess/API/cpp/gtk"
524     "${WEBKIT2_DIR}/UIProcess/API/gtk"
525     "${WEBKIT2_DIR}/UIProcess/Network/CustomProtocols/soup"
526     "${WEBKIT2_DIR}/UIProcess/Plugins/gtk"
527     "${WEBKIT2_DIR}/UIProcess/gstreamer"
528     "${WEBKIT2_DIR}/UIProcess/gtk"
529     "${WEBKIT2_DIR}/UIProcess/soup"
530     "${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk"
531     "${WEBKIT2_DIR}/WebProcess/Plugins/Netscape/unix"
532     "${WEBKIT2_DIR}/WebProcess/Plugins/Netscape/x11"
533     "${WEBKIT2_DIR}/WebProcess/gtk"
534     "${WEBKIT2_DIR}/WebProcess/soup"
535     "${WEBKIT2_DIR}/WebProcess/unix"
536     "${WEBKIT2_DIR}/WebProcess/WebCoreSupport/gtk"
537     "${WEBKIT2_DIR}/WebProcess/WebCoreSupport/soup"
538     "${WEBKIT2_DIR}/WebProcess/WebPage/atk"
539     "${WEBKIT2_DIR}/WebProcess/WebPage/gtk"
540     "${WTF_DIR}/wtf/gtk"
541     "${WTF_DIR}/wtf/glib"
542     "${WTF_DIR}"
543 )
544
545 list(APPEND WebKit2_SYSTEM_INCLUDE_DIRECTORIES
546     ${CAIRO_INCLUDE_DIRS}
547     ${ENCHANT_INCLUDE_DIRS}
548     ${GEOCLUE_INCLUDE_DIRS}
549     ${GSTREAMER_INCLUDE_DIRS}
550     ${HARFBUZZ_INCLUDE_DIRS}
551     ${LIBSOUP_INCLUDE_DIRS}
552 )
553
554 if (USE_LIBNOTIFY)
555 list(APPEND WebKit2_SYSTEM_INCLUDE_DIRECTORIES
556     ${LIBNOTIFY_INCLUDE_DIRS}
557 )
558 endif ()
559
560 set(WebKit2CommonIncludeDirectories ${WebKit2_INCLUDE_DIRECTORIES})
561 set(WebKit2CommonSystemIncludeDirectories ${WebKit2_SYSTEM_INCLUDE_DIRECTORIES})
562
563 list(APPEND WebKit2_SYSTEM_INCLUDE_DIRECTORIES
564     ${GLIB_INCLUDE_DIRS}
565     ${GTK_INCLUDE_DIRS}
566     ${GTK_UNIX_PRINT_INCLUDE_DIRS}
567 )
568
569 list(APPEND WebProcess_SOURCES
570     WebProcess/EntryPoint/unix/WebProcessMain.cpp
571 )
572
573 list(APPEND NetworkProcess_SOURCES
574     NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp
575 )
576
577 list(APPEND DatabaseProcess_SOURCES
578     DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp
579 )
580
581 file(WRITE ${CMAKE_BINARY_DIR}/test_atomic.cpp
582      "#include <atomic>\n"
583      "int main() { std::atomic<int64_t> i(0); i++; return 0; }\n")
584 try_compile(ATOMIC_BUILD_SUCCEEDED ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/test_atomic.cpp)
585 if (NOT ATOMIC_BUILD_SUCCEEDED)
586     list(APPEND WebKit2_LIBRARIES atomic)
587 endif ()
588 file(REMOVE ${CMAKE_BINARY_DIR}/test_atomic.cpp)
589
590 set(SharedWebKit2Libraries
591     ${WebKit2_LIBRARIES}
592 )
593
594 list(APPEND WebKit2_LIBRARIES
595     GObjectDOMBindings
596     WebCorePlatformGTK
597     ${GTK_UNIX_PRINT_LIBRARIES}
598 )
599
600 if (LIBNOTIFY_FOUND)
601 list(APPEND WebKit2_LIBRARIES
602     ${LIBNOTIFY_LIBRARIES}
603 )
604 endif ()
605
606 if (ENABLE_SECCOMP_FILTERS)
607     list(APPEND WebKit2_LIBRARIES
608         ${LIBSECCOMP_LIBRARIES}
609     )
610     list(APPEND WebKit2_SYSTEM_INCLUDE_DIRECTORIES
611         ${LIBSECCOMP_INCLUDE_DIRS}
612     )
613
614     # If building with WebKit jhbuild (not GNOME jhbuild), add the root build
615     # directory to the filesystem access policy.
616     if (DEVELOPER_MODE AND IS_DIRECTORY ${CMAKE_SOURCE_DIR}/WebKitBuild/DependenciesGTK)
617         add_definitions(-DSOURCE_DIR=\"${CMAKE_SOURCE_DIR}\")
618     endif ()
619 endif ()
620
621 ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKit2_LIBRARIES)
622
623 set(WebKit2_MARSHAL_LIST ${WEBKIT2_DIR}/UIProcess/API/gtk/webkit2marshal.list)
624 add_custom_command(
625     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
626            ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.h
627     MAIN_DEPENDENCY ${WebKit2_MARSHAL_LIST}
628
629     COMMAND echo extern \"C\" { > ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
630     COMMAND glib-genmarshal --prefix=webkit_marshal ${WebKit2_MARSHAL_LIST} --body >> ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
631     COMMAND echo } >> ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.cpp
632
633     COMMAND glib-genmarshal --prefix=webkit_marshal ${WebKit2_MARSHAL_LIST} --header > ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitMarshal.h
634     VERBATIM)
635
636 # To generate WebKitEnumTypes.h we want to use all installed headers, except WebKitEnumTypes.h itself.
637 set(WebKit2GTK_ENUM_GENERATION_HEADERS ${WebKit2GTK_INSTALLED_HEADERS})
638 list(REMOVE_ITEM WebKit2GTK_ENUM_GENERATION_HEADERS ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.h)
639 add_custom_command(
640     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.h
641            ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.cpp
642     DEPENDS ${WebKit2GTK_ENUM_GENERATION_HEADERS}
643
644     COMMAND glib-mkenums --template ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitEnumTypes.h.template ${WebKit2GTK_ENUM_GENERATION_HEADERS} | sed s/web_kit/webkit/ | sed s/WEBKIT_TYPE_KIT/WEBKIT_TYPE/ > ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.h
645
646     COMMAND glib-mkenums --template ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitEnumTypes.cpp.template ${WebKit2GTK_ENUM_GENERATION_HEADERS} | sed s/web_kit/webkit/ > ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.cpp
647     VERBATIM)
648
649 add_custom_command(
650     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
651     DEPENDS ${InspectorFilesDependencies}
652             ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
653             ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py
654     COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py --output=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml ${InspectorFiles} ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
655     VERBATIM
656 )
657
658 add_custom_command(
659     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
660     DEPENDS ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
661     COMMAND glib-compile-resources --generate --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebInspectorUI --sourcedir=${DERIVED_SOURCES_WEBINSPECTORUI_DIR} --target=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
662     VERBATIM
663 )
664
665 add_custom_command(
666     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c
667     DEPENDS ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml
668             ${WEBKIT2_DIR}/UIProcess/InspectorServer/front-end/inspectorPageIndex.html
669     COMMAND glib-compile-resources --generate --sourcedir=${WEBKIT2_DIR}/UIProcess/InspectorServer/front-end --target=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml
670     VERBATIM
671 )
672
673 set(WebKit2Resources
674     "        <file alias=\"images/missingImage\">missingImage.png</file>\n"
675     "        <file alias=\"images/missingImage@2x\">missingImage@2x.png</file>\n"
676     "        <file alias=\"images/panIcon\">panIcon.png</file>\n"
677     "        <file alias=\"images/textAreaResizeCorner\">textAreaResizeCorner.png</file>\n"
678     "        <file alias=\"images/textAreaResizeCorner@2x\">textAreaResizeCorner@2x.png</file>\n"
679 )
680
681 if (ENABLE_ICONDATABASE)
682     list(APPEND WebKit2Resources
683         "        <file alias=\"images/urlIcon\">urlIcon.png</file>\n"
684     )
685 endif ()
686
687 if (ENABLE_WEB_AUDIO)
688     list(APPEND WebKit2Resources
689         "        <file alias=\"audio/Composite\">Composite.wav</file>\n"
690     )
691 endif ()
692
693 file(WRITE ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.xml
694     "<?xml version=1.0 encoding=UTF-8?>\n"
695     "<gresources>\n"
696     "    <gresource prefix=\"/org/webkitgtk/resources\">\n"
697     ${WebKit2Resources}
698     "    </gresource>\n"
699     "</gresources>\n"
700 )
701
702 add_custom_command(
703     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.c
704     DEPENDS ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.xml
705     COMMAND glib-compile-resources --generate --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebCore/Resources --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebCore/platform/audio/resources --target=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.c ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.xml
706     VERBATIM
707 )
708
709 if (ENABLE_PLUGIN_PROCESS_GTK2)
710     set(PluginProcessGTK2_EXECUTABLE_NAME WebKitPluginProcess2)
711
712     # FIXME: We should figure out a way to avoid compiling files that are common between the plugin
713     # process and WebKit2 only once instead of recompiling them for the plugin process.
714     list(APPEND PluginProcessGTK2_SOURCES
715         Platform/Logging.cpp
716         Platform/Module.cpp
717
718         Platform/IPC/ArgumentCoders.cpp
719         Platform/IPC/ArgumentDecoder.cpp
720         Platform/IPC/ArgumentEncoder.cpp
721         Platform/IPC/Attachment.cpp
722         Platform/IPC/Connection.cpp
723         Platform/IPC/DataReference.cpp
724         Platform/IPC/MessageDecoder.cpp
725         Platform/IPC/MessageEncoder.cpp
726         Platform/IPC/MessageReceiverMap.cpp
727         Platform/IPC/MessageSender.cpp
728         Platform/IPC/StringReference.cpp
729
730         Platform/IPC/glib/GSocketMonitor.cpp
731         Platform/IPC/unix/AttachmentUnix.cpp
732         Platform/IPC/unix/ConnectionUnix.cpp
733
734         Platform/gtk/LoggingGtk.cpp
735         Platform/gtk/ModuleGtk.cpp
736
737         Platform/unix/SharedMemoryUnix.cpp
738
739         PluginProcess/PluginControllerProxy.cpp
740         PluginProcess/PluginCreationParameters.cpp
741         PluginProcess/PluginProcess.cpp
742         PluginProcess/WebProcessConnection.cpp
743
744         PluginProcess/EntryPoint/unix/PluginProcessMain.cpp
745
746         PluginProcess/unix/PluginControllerProxyUnix.cpp
747         PluginProcess/unix/PluginProcessMainUnix.cpp
748         PluginProcess/unix/PluginProcessUnix.cpp
749
750         Shared/ActivityAssertion.cpp
751         Shared/BlobDataFileReferenceWithSandboxExtension.cpp
752         Shared/ChildProcess.cpp
753         Shared/ShareableBitmap.cpp
754         Shared/WebCoreArgumentCoders.cpp
755         Shared/WebEvent.cpp
756         Shared/WebKeyboardEvent.cpp
757         Shared/WebKit2Initialize.cpp
758         Shared/WebMouseEvent.cpp
759         Shared/WebPlatformTouchPoint.cpp
760         Shared/WebTouchEvent.cpp
761         Shared/WebWheelEvent.cpp
762
763         Shared/Plugins/NPIdentifierData.cpp
764         Shared/Plugins/NPObjectMessageReceiver.cpp
765         Shared/Plugins/NPObjectProxy.cpp
766         Shared/Plugins/NPRemoteObjectMap.cpp
767         Shared/Plugins/NPVariantData.cpp
768         Shared/Plugins/PluginProcessCreationParameters.cpp
769
770         Shared/Plugins/Netscape/NetscapePluginModule.cpp
771         Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp
772
773         Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
774
775         Shared/cairo/ShareableBitmapCairo.cpp
776
777         Shared/gtk/NativeWebKeyboardEventGtk.cpp
778         Shared/gtk/NativeWebMouseEventGtk.cpp
779         Shared/gtk/NativeWebTouchEventGtk.cpp
780         Shared/gtk/NativeWebWheelEventGtk.cpp
781         Shared/gtk/ProcessExecutablePathGtk.cpp
782         Shared/gtk/WebEventFactory.cpp
783
784         Shared/soup/WebCoreArgumentCodersSoup.cpp
785
786         Shared/unix/ChildProcessMain.cpp
787
788         UIProcess/Launcher/ProcessLauncher.cpp
789
790         UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
791
792         UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
793
794         WebProcess/Plugins/Plugin.cpp
795
796         WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp
797         WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
798         WebProcess/Plugins/Netscape/NetscapePlugin.cpp
799         WebProcess/Plugins/Netscape/NetscapePluginNone.cpp
800         WebProcess/Plugins/Netscape/NetscapePluginStream.cpp
801
802         WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp
803         WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
804
805         ${DERIVED_SOURCES_WEBKIT2_DIR}/PluginControllerProxyMessageReceiver.cpp
806         ${DERIVED_SOURCES_WEBKIT2_DIR}/PluginProcessMessageReceiver.cpp
807         ${DERIVED_SOURCES_WEBKIT2_DIR}/WebProcessConnectionMessageReceiver.cpp
808         ${DERIVED_SOURCES_WEBKIT2_DIR}/NPObjectMessageReceiverMessageReceiver.cpp
809         ${DERIVED_SOURCES_WEBKIT2_DIR}/ChildProcessMessageReceiver.cpp
810     )
811
812     add_executable(WebKitPluginProcess2 ${PluginProcessGTK2_SOURCES})
813     add_webkit2_prefix_header(WebKitPluginProcess2)
814
815     # We need ENABLE_PLUGIN_PROCESS for all targets in this directory, but
816     # we only want GTK_API_VERSION_2 for the plugin process target.
817     set_property(
818         TARGET WebKitPluginProcess2
819         APPEND
820         PROPERTY COMPILE_DEFINITIONS GTK_API_VERSION_2=1
821     )
822     target_include_directories(WebKitPluginProcess2 PRIVATE
823         ${WebKit2CommonIncludeDirectories}
824     )
825     target_include_directories(WebKitPluginProcess2 SYSTEM PRIVATE
826          ${WebKit2CommonSystemIncludeDirectories}
827          ${GTK2_INCLUDE_DIRS}
828          ${GDK2_INCLUDE_DIRS}
829     )
830
831     set(WebKitPluginProcess2_LIBRARIES
832         ${SharedWebKit2Libraries}
833         WebCorePlatformGTK2
834     )
835     ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKitPluginProcess2_LIBRARIES)
836     target_link_libraries(WebKitPluginProcess2 ${WebKitPluginProcess2_LIBRARIES})
837
838     add_dependencies(WebKitPluginProcess2 WebKit2)
839
840     install(TARGETS WebKitPluginProcess2 DESTINATION "${LIBEXEC_INSTALL_DIR}")
841 endif () # ENABLE_PLUGIN_PROCESS_GTK2
842
843 # GTK3 PluginProcess
844 list(APPEND PluginProcess_SOURCES
845     PluginProcess/EntryPoint/unix/PluginProcessMain.cpp
846 )
847
848 if (ENABLE_THREADED_COMPOSITOR)
849     list(APPEND WebKit2_SOURCES
850         Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp
851         Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
852         Shared/CoordinatedGraphics/SimpleViewportController.cpp
853
854         Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp
855         Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
856
857         WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
858     )
859     list(APPEND WebKit2_INCLUDE_DIRECTORIES
860         "${WEBCORE_DIR}/platform/graphics/texmap/coordinated"
861         "${WEBKIT2_DIR}/Shared/CoordinatedGraphics"
862         "${WEBKIT2_DIR}/Shared/CoordinatedGraphics/threadedcompositor"
863         "${WEBKIT2_DIR}/WebProcess/WebPage/CoordinatedGraphics"
864     )
865 else (ENABLE_THREADED_COMPOSITOR)
866     list(APPEND WebKit2_SOURCES
867         WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
868     )
869 endif ()
870
871 # Commands for building the built-in injected bundle.
872 include_directories(
873     "${WEBKIT2_DIR}/Platform"
874     "${WEBKIT2_DIR}/Shared"
875     "${WEBKIT2_DIR}/Shared/API/c"
876     "${WEBKIT2_DIR}/UIProcess/API/C"
877     "${WEBKIT2_DIR}/WebProcess/InjectedBundle"
878     "${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/c"
879     "${DERIVED_SOURCES_DIR}"
880     "${DERIVED_SOURCES_DIR}/InjectedBundle"
881     "${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}"
882     "${FORWARDING_HEADERS_DIR}"
883     "${FORWARDING_HEADERS_WEBKIT2GTK_DIR}"
884 )
885
886 add_library(webkit2gtkinjectedbundle MODULE "${WEBKIT2_DIR}/WebProcess/gtk/WebGtkInjectedBundleMain.cpp")
887 add_dependencies(webkit2gtkinjectedbundle GObjectDOMBindings)
888 add_webkit2_prefix_header(webkit2gtkinjectedbundle)
889 target_link_libraries(webkit2gtkinjectedbundle WebKit2)
890
891 # Add ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} to LD_LIBRARY_PATH
892 string(COMPARE EQUAL "$ENV{LD_LIBRARY_PATH}" "" ld_library_path_not_exist)
893 if (ld_library_path_does_not_exist)
894     set(INTROSPECTION_ADDITIONAL_LIBRARY_PATH
895         "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
896     )
897 else ()
898     set(INTROSPECTION_ADDITIONAL_LIBRARY_PATH
899         "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{LD_LIBRARY_PATH}"
900     )
901 endif ()
902
903 # Add required -L flags from ${CMAKE_SHARED_LINKER_FLAGS} for g-ir-scanner
904 string(REGEX MATCHALL "-L[^ ]*"
905     INTROSPECTION_ADDITIONAL_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
906
907 add_custom_command(
908     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
909     DEPENDS WebKit2
910     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
911     COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations LDFLAGS=
912         LD_LIBRARY_PATH="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
913         ${INTROSPECTION_SCANNER}
914         --quiet
915         --warn-all
916         --symbol-prefix=webkit
917         --identifier-prefix=WebKit
918         --namespace=WebKit2
919         --nsversion=${WEBKITGTK_API_VERSION}
920         --include=GObject-2.0
921         --include=Gtk-3.0
922         --include=Soup-2.4
923         --include-uninstalled=${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
924         --library=webkit2gtk-${WEBKITGTK_API_VERSION}
925         --library=javascriptcoregtk-${WEBKITGTK_API_VERSION}
926         -L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
927         ${INTROSPECTION_ADDITIONAL_LINKER_FLAGS}
928         --no-libtool
929         --pkg=gobject-2.0
930         --pkg=gtk+-3.0
931         --pkg=libsoup-2.4
932         --pkg-export=webkit2gtk-${WEBKITGTK_API_VERSION}
933         --output=${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
934         --c-include="webkit2/webkit2.h"
935         -DBUILDING_WEBKIT
936         -DWEBKIT2_COMPILATION
937         -I${CMAKE_SOURCE_DIR}/Source
938         -I${WEBKIT2_DIR}
939         -I${JAVASCRIPTCORE_DIR}
940         -I${JAVASCRIPTCORE_DIR}/ForwardingHeaders
941         -I${DERIVED_SOURCES_DIR}
942         -I${DERIVED_SOURCES_WEBKIT2GTK_DIR}
943         -I${FORWARDING_HEADERS_WEBKIT2GTK_DIR}
944         ${WebKit2GTK_INSTALLED_HEADERS}
945         ${WEBKIT2_DIR}/UIProcess/API/gtk/*.cpp
946 )
947
948 add_custom_command(
949     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
950     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
951     DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
952     COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations
953         LDFLAGS="${INTROSPECTION_ADDITIONAL_LDFLAGS}"
954         LD_LIBRARY_PATH="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
955         ${INTROSPECTION_SCANNER}
956         --quiet
957         --warn-all
958         --symbol-prefix=webkit
959         --identifier-prefix=WebKit
960         --namespace=WebKit2WebExtension
961         --nsversion=${WEBKITGTK_API_VERSION}
962         --include=GObject-2.0
963         --include=Gtk-3.0
964         --include=Soup-2.4
965         --include-uninstalled=${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
966         --library=webkit2gtk-${WEBKITGTK_API_VERSION}
967         --library=javascriptcoregtk-${WEBKITGTK_API_VERSION}
968         ${INTROSPECTION_ADDITIONAL_LIBRARIES}
969         -L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
970         ${INTROSPECTION_ADDITIONAL_LINKER_FLAGS}
971         --no-libtool
972         --pkg=gobject-2.0
973         --pkg=gtk+-3.0
974         --pkg=libsoup-2.4
975         --pkg-export=webkit2gtk-web-extension-${WEBKITGTK_API_VERSION}
976         --output=${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
977         --c-include="webkit2/webkit-web-extension.h"
978         -DBUILDING_WEBKIT
979         -DWEBKIT2_COMPILATION
980         -I${CMAKE_SOURCE_DIR}/Source
981         -I${WEBKIT2_DIR}
982         -I${JAVASCRIPTCORE_DIR}
983         -I${JAVASCRIPTCORE_DIR}/ForwardingHeaders
984         -I${DERIVED_SOURCES_DIR}
985         -I${DERIVED_SOURCES_WEBKIT2GTK_DIR}
986         -I${FORWARDING_HEADERS_DIR}
987         -I${FORWARDING_HEADERS_WEBKIT2GTK_DIR}
988         -I${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}
989         -I${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk
990         ${GObjectDOMBindings_GIR_HEADERS}
991         ${WebKit2WebExtension_INSTALLED_HEADERS}
992         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenu.h
993         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenu.cpp
994         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuActions.h
995         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuItem.h
996         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuItem.cpp
997         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitHitTestResult.h
998         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURIRequest.h
999         ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitURIResponse.h
1000         ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/*.cpp
1001 )
1002
1003 add_custom_command(
1004     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
1005     DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
1006     COMMAND ${INTROSPECTION_COMPILER} --includedir=${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir -o ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
1007 )
1008
1009 add_custom_command(
1010     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib
1011     DEPENDS ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
1012     COMMAND ${INTROSPECTION_COMPILER} --includedir=${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir -o ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib
1013 )
1014
1015 ADD_TYPELIB(${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib)
1016 ADD_TYPELIB(${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib)
1017
1018 install(TARGETS webkit2gtkinjectedbundle
1019         DESTINATION "${LIB_INSTALL_DIR}/webkit2gtk-${WEBKITGTK_API_VERSION}/injected-bundle"
1020 )
1021 install(FILES "${CMAKE_BINARY_DIR}/Source/WebKit2/webkit2gtk-${WEBKITGTK_API_VERSION}.pc"
1022               "${CMAKE_BINARY_DIR}/Source/WebKit2/webkit2gtk-web-extension-${WEBKITGTK_API_VERSION}.pc"
1023         DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
1024 )
1025 install(FILES ${WebKit2GTK_INSTALLED_HEADERS}
1026               ${WebKit2WebExtension_INSTALLED_HEADERS}
1027         DESTINATION "${WEBKITGTK_HEADER_INSTALL_DIR}/webkit2"
1028 )
1029
1030 if (ENABLE_INTROSPECTION)
1031     install(FILES ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
1032                   ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
1033             DESTINATION ${INTROSPECTION_INSTALL_GIRDIR}
1034     )
1035     install(FILES ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
1036                   ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib
1037             DESTINATION ${INTROSPECTION_INSTALL_TYPELIBDIR}
1038     )
1039 endif ()
1040
1041 file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkit2gtk.cfg
1042     "[webkit2gtk-${WEBKITGTK_API_VERSION}]\n"
1043     "pkgconfig_file=${WebKit2_PKGCONFIG_FILE}\n"
1044     "namespace=webkit\n"
1045     "cflags=-I${CMAKE_SOURCE_DIR}/Source\n"
1046     "       -I${WEBKIT2_DIR}/UIProcess/API/gtk\n"
1047     "       -I${DERIVED_SOURCES_WEBKIT2GTK_DIR}\n"
1048     "       -I${FORWARDING_HEADERS_WEBKIT2GTK_DIR}\n"
1049     "doc_dir=${WEBKIT2_DIR}/UIProcess/API/gtk/docs\n"
1050     "source_dirs=${WEBKIT2_DIR}/UIProcess/API/gtk\n"
1051     "            ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk\n"
1052     "            ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}\n"
1053     "headers=${WebKit2GTK_ENUM_GENERATION_HEADERS} ${WebKit2WebExtension_INSTALLED_HEADERS}\n"
1054     "main_sgml_file=webkit2gtk-docs.sgml\n"
1055 )
1056
1057 add_custom_target(WebKit2-forwarding-headers
1058     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${WEBKIT2_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk --platform soup
1059 )
1060
1061 # These symbolic link allows includes like #include <webkit2/WebkitWebView.h> which simulates installed headers.
1062 add_custom_command(
1063     OUTPUT ${FORWARDING_HEADERS_WEBKIT2GTK_DIR}/webkit2
1064     DEPENDS ${WEBKIT2_DIR}/UIProcess/API/gtk
1065     COMMAND ln -n -s -f ${WEBKIT2_DIR}/UIProcess/API/gtk ${FORWARDING_HEADERS_WEBKIT2GTK_DIR}/webkit2
1066 )
1067 add_custom_command(
1068     OUTPUT ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}/webkit2
1069     DEPENDS ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk
1070     COMMAND ln -n -s -f ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}/webkit2
1071 )
1072 add_custom_target(WebKit2-fake-api-headers
1073     DEPENDS ${FORWARDING_HEADERS_WEBKIT2GTK_DIR}/webkit2
1074             ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}/webkit2
1075 )
1076
1077 set(WEBKIT2_EXTRA_DEPENDENCIES
1078      WebKit2-fake-api-headers
1079      WebKit2-forwarding-headers
1080 )