[GLIB][GTK] Unreviewed test gardening. Updated expectations and baselines after 270164.
[WebKit-https.git] / Source / WebKit / CMakeLists.txt
1 include(WebKitCommon)
2
3 set_property(DIRECTORY . PROPERTY FOLDER "WebKit")
4
5 if (PAL_LIBRARY_TYPE MATCHES STATIC)
6     add_definitions(-DSTATICALLY_LINKED_WITH_PAL=1)
7 endif ()
8
9 set(WebKit_PRIVATE_INCLUDE_DIRECTORIES
10     "${CMAKE_BINARY_DIR}"
11 )
12
13 set(WebKit_INCLUDE_DIRECTORIES
14     "${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}"
15     "${WebKit_FRAMEWORK_HEADERS_DIR}"
16     "${WebKit_DERIVED_SOURCES_DIR}"
17     "${WebKit_DERIVED_SOURCES_DIR}/include"
18     "${WEBKIT_DIR}"
19     "${WEBKIT_DIR}/GPUProcess"
20     "${WEBKIT_DIR}/GPUProcess/graphics"
21     "${WEBKIT_DIR}/GPUProcess/media"
22     "${WEBKIT_DIR}/GPUProcess/webrtc"
23     "${WEBKIT_DIR}/NetworkProcess"
24     "${WEBKIT_DIR}/NetworkProcess/Classifier"
25     "${WEBKIT_DIR}/NetworkProcess/Cookies"
26     "${WEBKIT_DIR}/NetworkProcess/CustomProtocols"
27     "${WEBKIT_DIR}/NetworkProcess/Downloads"
28     "${WEBKIT_DIR}/NetworkProcess/FileAPI"
29     "${WEBKIT_DIR}/NetworkProcess/IndexedDB"
30     "${WEBKIT_DIR}/NetworkProcess/ServiceWorker"
31     "${WEBKIT_DIR}/NetworkProcess/WebStorage"
32     "${WEBKIT_DIR}/NetworkProcess/cache"
33     "${WEBKIT_DIR}/NetworkProcess/watchos"
34     "${WEBKIT_DIR}/NetworkProcess/webrtc"
35     "${WEBKIT_DIR}/Platform"
36     "${WEBKIT_DIR}/Platform/IPC"
37     "${WEBKIT_DIR}/PluginProcess"
38     "${WEBKIT_DIR}/Shared"
39     "${WEBKIT_DIR}/Shared/API"
40     "${WEBKIT_DIR}/Shared/API/c"
41     "${WEBKIT_DIR}/Shared/ApplePay"
42     "${WEBKIT_DIR}/Shared/Authentication"
43     "${WEBKIT_DIR}/Shared/CoreIPCSupport"
44     "${WEBKIT_DIR}/Shared/Databases"
45     "${WEBKIT_DIR}/Shared/Databases/IndexedDB"
46     "${WEBKIT_DIR}/Shared/FileAPI"
47     "${WEBKIT_DIR}/Shared/Gamepad"
48     "${WEBKIT_DIR}/Shared/Plugins"
49     "${WEBKIT_DIR}/Shared/Plugins/Netscape"
50     "${WEBKIT_DIR}/Shared/Plugins/Netscape/x11"
51     "${WEBKIT_DIR}/Shared/RemoteLayerTree"
52     "${WEBKIT_DIR}/Shared/WebsiteData"
53     "${WEBKIT_DIR}/UIProcess"
54     "${WEBKIT_DIR}/UIProcess/API"
55     "${WEBKIT_DIR}/UIProcess/API/C"
56     "${WEBKIT_DIR}/UIProcess/API/cpp"
57     "${WEBKIT_DIR}/UIProcess/Authentication"
58     "${WEBKIT_DIR}/UIProcess/Automation"
59     "${WEBKIT_DIR}/UIProcess/Downloads"
60     "${WEBKIT_DIR}/UIProcess/Gamepad"
61     "${WEBKIT_DIR}/UIProcess/GPU"
62     "${WEBKIT_DIR}/UIProcess/Inspector"
63     "${WEBKIT_DIR}/UIProcess/Inspector/Agents"
64     "${WEBKIT_DIR}/UIProcess/Launcher"
65     "${WEBKIT_DIR}/UIProcess/Network"
66     "${WEBKIT_DIR}/UIProcess/Network/CustomProtocols"
67     "${WEBKIT_DIR}/UIProcess/Notifications"
68     "${WEBKIT_DIR}/UIProcess/Plugins"
69     "${WEBKIT_DIR}/UIProcess/RemoteLayerTree"
70     "${WEBKIT_DIR}/UIProcess/UserContent"
71     "${WEBKIT_DIR}/UIProcess/WebAuthentication"
72     "${WEBKIT_DIR}/UIProcess/WebAuthentication/Mock"
73     "${WEBKIT_DIR}/UIProcess/WebsiteData"
74     "${WEBKIT_DIR}/WebAuthnProcess"
75     "${WEBKIT_DIR}/WebProcess"
76     "${WEBKIT_DIR}/WebProcess/ApplePay"
77     "${WEBKIT_DIR}/WebProcess/ApplicationCache"
78     "${WEBKIT_DIR}/WebProcess/Automation"
79     "${WEBKIT_DIR}/WebProcess/Cache"
80     "${WEBKIT_DIR}/WebProcess/Databases"
81     "${WEBKIT_DIR}/WebProcess/Databases/IndexedDB"
82     "${WEBKIT_DIR}/WebProcess/FileAPI"
83     "${WEBKIT_DIR}/WebProcess/FullScreen"
84     "${WEBKIT_DIR}/WebProcess/Gamepad"
85     "${WEBKIT_DIR}/WebProcess/Geolocation"
86     "${WEBKIT_DIR}/WebProcess/GPU"
87     "${WEBKIT_DIR}/WebProcess/GPU/graphics"
88     "${WEBKIT_DIR}/WebProcess/GPU/media"
89     "${WEBKIT_DIR}/WebProcess/GPU/webrtc"
90     "${WEBKIT_DIR}/WebProcess/IconDatabase"
91     "${WEBKIT_DIR}/WebProcess/InjectedBundle"
92     "${WEBKIT_DIR}/WebProcess/InjectedBundle/API"
93     "${WEBKIT_DIR}/WebProcess/InjectedBundle/API/c"
94     "${WEBKIT_DIR}/WebProcess/InjectedBundle/DOM"
95     "${WEBKIT_DIR}/WebProcess/Inspector"
96     "${WEBKIT_DIR}/WebProcess/Launching"
97     "${WEBKIT_DIR}/WebProcess/MediaCache"
98     "${WEBKIT_DIR}/WebProcess/MediaStream"
99     "${WEBKIT_DIR}/WebProcess/Network"
100     "${WEBKIT_DIR}/WebProcess/Network/webrtc"
101     "${WEBKIT_DIR}/WebProcess/Notifications"
102     "${WEBKIT_DIR}/WebProcess/OriginData"
103     "${WEBKIT_DIR}/WebProcess/Plugins"
104     "${WEBKIT_DIR}/WebProcess/Plugins/Netscape"
105     "${WEBKIT_DIR}/WebProcess/ResourceCache"
106     "${WEBKIT_DIR}/WebProcess/Storage"
107     "${WEBKIT_DIR}/WebProcess/UserContent"
108     "${WEBKIT_DIR}/WebProcess/WebCoreSupport"
109     "${WEBKIT_DIR}/WebProcess/WebPage"
110     "${WEBKIT_DIR}/WebProcess/WebPage/RemoteLayerTree"
111     "${WEBKIT_DIR}/WebProcess/WebStorage"
112     "${CMAKE_SOURCE_DIR}/Source"
113     "${CMAKE_SOURCE_DIR}/WebKitLibraries"
114 )
115
116 set(PROTOCOL_GENERATOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
117
118 list(APPEND WebKit_UNIFIED_SOURCE_LIST_FILES
119     "Sources.txt"
120 )
121
122 set(WebKit_MESSAGES_IN_FILES
123     GPUProcess/GPUConnectionToWebProcess
124     GPUProcess/GPUProcess
125
126     GPUProcess/graphics/RemoteRenderingBackend
127
128     GPUProcess/media/RemoteAudioDestinationManager
129     GPUProcess/media/RemoteAudioSessionProxy
130     GPUProcess/media/RemoteCDMFactoryProxy
131     GPUProcess/media/RemoteCDMInstanceProxy
132     GPUProcess/media/RemoteCDMInstanceSessionProxy
133     GPUProcess/media/RemoteCDMProxy
134     GPUProcess/media/RemoteLegacyCDMFactoryProxy
135     GPUProcess/media/RemoteLegacyCDMProxy
136     GPUProcess/media/RemoteLegacyCDMSessionProxy
137     GPUProcess/media/RemoteMediaPlayerManagerProxy
138     GPUProcess/media/RemoteMediaPlayerProxy
139     GPUProcess/media/RemoteMediaResourceManager
140     GPUProcess/media/RemoteMediaSourceProxy
141     GPUProcess/media/RemoteSourceBufferProxy
142
143     GPUProcess/webrtc/LibWebRTCCodecsProxy
144     GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer
145     GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager
146     GPUProcess/webrtc/RemoteMediaRecorder
147     GPUProcess/webrtc/RemoteMediaRecorderManager
148     GPUProcess/webrtc/RemoteSampleBufferDisplayLayer
149     GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager
150
151     NetworkProcess/Cookies/WebCookieManager
152
153     NetworkProcess/IndexedDB/WebIDBServer
154
155     NetworkProcess/NetworkConnectionToWebProcess
156     NetworkProcess/NetworkContentRuleListManager
157     NetworkProcess/NetworkProcess
158     NetworkProcess/NetworkResourceLoader
159     NetworkProcess/NetworkSocketChannel
160     NetworkProcess/NetworkSocketStream
161
162     NetworkProcess/ServiceWorker/ServiceWorkerFetchTask
163     NetworkProcess/ServiceWorker/WebSWServerConnection
164     NetworkProcess/ServiceWorker/WebSWServerToContextConnection
165
166     NetworkProcess/WebStorage/StorageManagerSet
167
168     NetworkProcess/cache/CacheStorageEngineConnection
169
170     NetworkProcess/webrtc/NetworkMDNSRegister
171     NetworkProcess/webrtc/NetworkRTCMonitor
172     NetworkProcess/webrtc/NetworkRTCProvider
173
174     PluginProcess/PluginControllerProxy
175     PluginProcess/PluginProcess
176     PluginProcess/WebProcessConnection
177
178     Shared/AuxiliaryProcess
179     Shared/WebConnection
180
181     Shared/Authentication/AuthenticationManager
182
183     Shared/Plugins/NPObjectMessageReceiver
184
185     UIProcess/DrawingAreaProxy
186     UIProcess/SpeechRecognitionServer
187     UIProcess/VisitedLinkStore
188     UIProcess/WebCookieManagerProxy
189     UIProcess/WebFullScreenManagerProxy
190     UIProcess/WebGeolocationManagerProxy
191     UIProcess/WebPageProxy
192     UIProcess/WebPasteboardProxy
193     UIProcess/WebProcessPool
194     UIProcess/WebProcessProxy
195
196     UIProcess/Automation/WebAutomationSession
197
198     UIProcess/Downloads/DownloadProxy
199
200     UIProcess/GPU/GPUProcessProxy
201
202     UIProcess/Inspector/RemoteWebInspectorProxy
203     UIProcess/Inspector/WebInspectorProxy
204
205     UIProcess/Network/NetworkProcessProxy
206
207     UIProcess/Plugins/PluginProcessProxy
208
209     UIProcess/UserContent/WebUserContentControllerProxy
210
211     WebProcess/WebProcess
212
213     WebProcess/Automation/WebAutomationSessionProxy
214
215     WebProcess/Databases/IndexedDB/WebIDBConnectionToServer
216
217     WebProcess/FullScreen/WebFullScreenManager
218
219     WebProcess/GPU/GPUProcessConnection
220
221     WebProcess/GPU/graphics/RemoteRenderingBackendProxy
222
223     WebProcess/GPU/media/MediaPlayerPrivateRemote
224     WebProcess/GPU/media/RemoteAudioDestinationProxy
225     WebProcess/GPU/media/RemoteAudioSession
226     WebProcess/GPU/media/RemoteAudioSourceProviderManager
227     WebProcess/GPU/media/RemoteCDMInstanceSession
228     WebProcess/GPU/media/RemoteLegacyCDMSession
229     WebProcess/GPU/media/SourceBufferPrivateRemote
230
231     WebProcess/GPU/webrtc/LibWebRTCCodecs
232     WebProcess/GPU/webrtc/SampleBufferDisplayLayer
233
234     WebProcess/Geolocation/WebGeolocationManager
235
236     WebProcess/Inspector/RemoteWebInspectorUI
237     WebProcess/Inspector/WebInspector
238     WebProcess/Inspector/WebInspectorInterruptDispatcher
239     WebProcess/Inspector/WebInspectorUI
240
241     WebProcess/Network/webrtc/LibWebRTCNetwork
242     WebProcess/Network/webrtc/WebMDNSRegister
243     WebProcess/Network/webrtc/WebRTCMonitor
244     WebProcess/Network/webrtc/WebRTCResolver
245
246     WebProcess/Network/NetworkProcessConnection
247     WebProcess/Network/WebResourceLoader
248     WebProcess/Network/WebSocketChannel
249     WebProcess/Network/WebSocketStream
250
251     WebProcess/Notifications/WebNotificationManager
252
253     WebProcess/Plugins/PluginProcessConnection
254     WebProcess/Plugins/PluginProcessConnectionManager
255     WebProcess/Plugins/PluginProxy
256
257     WebProcess/Storage/WebSWClientConnection
258     WebProcess/Storage/WebSWContextManagerConnection
259
260     WebProcess/UserContent/WebUserContentController
261
262     WebProcess/WebCoreSupport/WebSpeechRecognitionConnection
263
264     WebProcess/WebPage/DrawingArea
265     WebProcess/WebPage/EventDispatcher
266     WebProcess/WebPage/VisitedLinkTableController
267     WebProcess/WebPage/WebPage
268
269     WebProcess/WebStorage/StorageAreaMap
270 )
271
272 # FIXME: https://bugs.webkit.org/show_bug.cgi?id=210366
273 set(WebKit_LIBRARIES WebKit::WebCore)
274
275 set(WebProcess_LIBRARIES
276     WebKit
277 )
278
279 set(NetworkProcess_LIBRARIES
280     WebKit
281 )
282
283 set(GPUProcess_LIBRARIES
284     WebKit
285 )
286
287 set(PluginProcess_LIBRARIES
288     WebKit
289 )
290
291 if (ENABLE_ENCRYPTED_MEDIA AND ENABLE_OPENCDM)
292   list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
293       ${OPENCDM_INCLUDE_DIRS}
294   )
295 endif ()
296
297 if (ENABLE_GRAPHICS_CONTEXT_GL)
298     # For platforms that want to use system-provided OpenGL (ES) / EGL headers,
299     # these include directories, libraries or definitions need to be
300     # added before the ANGLE directories.
301     if (USE_LIBEPOXY)
302         list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
303             ${LIBEPOXY_INCLUDE_DIRS}
304         )
305         list(APPEND WebKit_PRIVATE_LIBRARIES
306             ${LIBEPOXY_LIBRARIES}
307         )
308         add_definitions(${LIBEPOXY_DEFINITIONS})
309     else ()
310         if (USE_OPENGL)
311             list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
312                 ${OPENGL_INCLUDE_DIRS}
313             )
314             list(APPEND WebKit_PRIVATE_LIBRARIES
315                 ${OPENGL_LIBRARIES}
316             )
317             add_definitions(${OPENGL_DEFINITIONS})
318         elseif (USE_OPENGL_ES)
319             list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
320                 ${OPENGLES2_INCLUDE_DIRS}
321             )
322             list(APPEND WebKit_PRIVATE_LIBRARIES
323                 ${OPENGLES2_LIBRARIES}
324             )
325             add_definitions(${OPENGLES2_DEFINITIONS})
326         endif ()
327
328         if (USE_EGL)
329             list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
330                 ${EGL_INCLUDE_DIRS}
331             )
332             list(APPEND WebKit_PRIVATE_LIBRARIES
333                 ${EGL_LIBRARIES}
334             )
335             add_definitions(${EGL_DEFINITIONS})
336         endif ()
337     endif ()
338 endif ()
339
340 if (USE_LIBWEBRTC)
341     list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/libwebrtc/Source/"
342         "${THIRDPARTY_DIR}/libwebrtc/Source/webrtc"
343         "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/abseil-cpp")
344     list(APPEND WebKit_LIBRARIES webrtc)
345 endif ()
346
347 if (ATOMIC_INT64_REQUIRES_LIBATOMIC)
348     list(APPEND WebKit_PRIVATE_LIBRARIES atomic)
349 endif ()
350
351 if (UNIX)
352     check_function_exists(shm_open SHM_OPEN_EXISTS)
353     if (NOT SHM_OPEN_EXISTS)
354         set(CMAKE_REQUIRED_LIBRARIES rt)
355         check_function_exists(shm_open SHM_OPEN_REQUIRES_LIBRT)
356         if (SHM_OPEN_REQUIRES_LIBRT)
357             list(APPEND WebKit_PRIVATE_LIBRARIES rt)
358         endif ()
359         unset(CMAKE_REQUIRED_LIBRARIES)
360     endif ()
361 endif ()
362
363 macro(ADD_WEBKIT_PREFIX_HEADER _target)
364     if (WebKit_USE_PREFIX_HEADER)
365         get_target_property(OLD_COMPILE_FLAGS ${_target} COMPILE_FLAGS)
366         if (${OLD_COMPILE_FLAGS} STREQUAL "OLD_COMPILE_FLAGS-NOTFOUND")
367             set(OLD_COMPILE_FLAGS "")
368         endif ()
369         set_target_properties(${_target} PROPERTIES COMPILE_FLAGS "${OLD_COMPILE_FLAGS} -include ${WEBKIT_DIR}/WebKit2Prefix.h")
370     endif ()
371 endmacro()
372
373 set(WebKit_AUTOMATION_PROTOCOL_GENERATOR_EXTRA_FLAGS)
374
375 set(WebKit_INTERFACE_LIBRARIES WebKit)
376 set(WebKit_INTERFACE_INCLUDE_DIRECTORIES
377     ${WebKit_FRAMEWORK_HEADERS_DIR}
378     ${WebKit_PRIVATE_FRAMEWORK_HEADERS_DIR}
379 )
380 set(WebKit_INTERFACE_DEPENDENCIES
381     NetworkProcess
382     WebProcess
383 )
384
385 WEBKIT_EXECUTABLE_DECLARE(WebProcess)
386 WEBKIT_EXECUTABLE_DECLARE(NetworkProcess)
387
388 if (ENABLE_GPU_PROCESS)
389     WEBKIT_EXECUTABLE_DECLARE(GPUProcess)
390     list(APPEND WebKit_INTERFACE_DEPENDENCIES GPUProcess)
391 endif ()
392
393 if (ENABLE_PLUGIN_PROCESS)
394     WEBKIT_EXECUTABLE_DECLARE(PluginProcess)
395     list(APPEND WebKit_INTERFACE_DEPENDENCIES PluginProcess)
396 endif ()
397
398 WEBKIT_FRAMEWORK_DECLARE(WebKit)
399 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
400
401 if (WebKit_PUBLIC_FRAMEWORK_HEADERS)
402     WEBKIT_COPY_FILES(WebKit_CopyHeaders
403         DESTINATION ${WebKit_FRAMEWORK_HEADERS_DIR}/WebKit
404         FILES ${WebKit_PUBLIC_FRAMEWORK_HEADERS}
405         FLATTENED
406     )
407     list(APPEND WebKit_DEPENDENCIES WebKit_CopyHeaders)
408 endif ()
409
410 if (WebKit_PRIVATE_FRAMEWORK_HEADERS)
411     WEBKIT_COPY_FILES(WebKit_CopyPrivateHeaders
412         DESTINATION ${WebKit_PRIVATE_FRAMEWORK_HEADERS_DIR}/WebKit
413         FILES ${WebKit_PRIVATE_FRAMEWORK_HEADERS}
414         FLATTENED
415     )
416     list(APPEND WebKit_INTERFACE_DEPENDENCIES WebKit_CopyPrivateHeaders)
417 endif ()
418
419 # Helper macro which wraps the generate-message-receiver.py script
420 #   _output_source is a list name which will contain generated sources.(eg. WebKit_SOURCES)
421 #   _inputs are messages.in files to generate.
422 macro(GENERATE_MESSAGE_SOURCES _output_source _inputs)
423     unset(_input_files)
424     unset(_outputs)
425     foreach (_file IN ITEMS ${_inputs})
426         get_filename_component(_name ${_file} NAME_WE)
427         list(APPEND _input_files ${WEBKIT_DIR}/${_file}.messages.in)
428         list(APPEND _outputs
429             ${WebKit_DERIVED_SOURCES_DIR}/${_name}MessageReceiver.cpp
430             ${WebKit_DERIVED_SOURCES_DIR}/${_name}Messages.h
431             ${WebKit_DERIVED_SOURCES_DIR}/${_name}MessagesReplies.h
432         )
433         list(APPEND ${_output_source} ${WebKit_DERIVED_SOURCES_DIR}/${_name}MessageReceiver.cpp)
434     endforeach ()
435     list(APPEND ${_output_source} ${WebKit_DERIVED_SOURCES_DIR}/MessageNames.cpp)
436
437     add_custom_command(
438         OUTPUT
439             ${WebKit_DERIVED_SOURCES_DIR}/MessageArgumentDescriptions.cpp
440             ${WebKit_DERIVED_SOURCES_DIR}/MessageNames.cpp
441             ${WebKit_DERIVED_SOURCES_DIR}/MessageNames.h
442             ${_outputs}
443         MAIN_DEPENDENCY ${WEBKIT_DIR}/Scripts/generate-message-receiver.py
444         DEPENDS
445             ${WEBKIT_DIR}/Scripts/webkit/__init__.py
446             ${WEBKIT_DIR}/Scripts/webkit/messages.py
447             ${WEBKIT_DIR}/Scripts/webkit/model.py
448             ${WEBKIT_DIR}/Scripts/webkit/parser.py
449             ${_input_files}
450         COMMAND ${PYTHON_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-message-receiver.py ${WEBKIT_DIR} ${_inputs}
451         WORKING_DIRECTORY ${WebKit_DERIVED_SOURCES_DIR}
452         VERBATIM
453     )
454 endmacro()
455 GENERATE_MESSAGE_SOURCES(WebKit_DERIVED_SOURCES "${WebKit_MESSAGES_IN_FILES}")
456
457 set(WebKit_AUTOMATION_PROTOCOL_GENERATOR_SCRIPTS
458     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py
459     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/cpp_generator.py
460     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/cpp_generator_templates.py
461     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_header.py
462     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_implementation.py
463     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_header.py
464     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_implementation.py
465     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_header.py
466     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_implementation.py
467     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generator.py
468     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generator_templates.py
469     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/models.py
470 )
471
472 set(WebKit_AUTOMATION_PROTOCOL_GENERATOR_INPUTS
473     ${WEBKIT_DIR}/UIProcess/Automation/Automation.json
474 )
475
476 add_custom_command(
477     OUTPUT ${WebKit_DERIVED_SOURCES_DIR}/AutomationBackendDispatchers.h ${WebKit_DERIVED_SOURCES_DIR}/AutomationBackendDispatchers.cpp ${WebKit_DERIVED_SOURCES_DIR}/AutomationProtocolObjects.h ${WebKit_DERIVED_SOURCES_DIR}/AutomationProtocolObjects.cpp ${WebKit_DERIVED_SOURCES_DIR}/AutomationFrontendDispatchers.h ${WebKit_DERIVED_SOURCES_DIR}/AutomationFrontendDispatchers.cpp
478     MAIN_DEPENDENCY ${WebKit_AUTOMATION_PROTOCOL_GENERATOR_INPUTS}
479     DEPENDS ${WebKit_AUTOMATION_PROTOCOL_GENERATOR_SCRIPTS}
480     COMMAND ${PYTHON_EXECUTABLE} ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py --outputDir "${WebKit_DERIVED_SOURCES_DIR}" --framework WebKit ${WebKit_AUTOMATION_PROTOCOL_GENERATOR_EXTRA_FLAGS} --backend ${WebKit_AUTOMATION_PROTOCOL_GENERATOR_INPUTS}
481     VERBATIM)
482
483 list(APPEND WebKit_HEADERS
484     ${WebKit_DERIVED_SOURCES_DIR}/AutomationBackendDispatchers.h
485     ${WebKit_DERIVED_SOURCES_DIR}/AutomationFrontendDispatchers.h
486     ${WebKit_DERIVED_SOURCES_DIR}/AutomationProtocolObjects.h
487 )
488
489 list(APPEND WebKit_SOURCES
490     ${WebKit_DERIVED_SOURCES_DIR}/AutomationBackendDispatchers.cpp
491     ${WebKit_DERIVED_SOURCES_DIR}/AutomationFrontendDispatchers.cpp
492     ${WebKit_DERIVED_SOURCES_DIR}/AutomationProtocolObjects.cpp
493 )
494
495 add_custom_command(
496     OUTPUT ${WebKit_DERIVED_SOURCES_DIR}/WebAutomationSessionProxyScriptSource.h ${WebKit_DERIVED_SOURCES_DIR}/WebAutomationSessionProxy.min.js
497     MAIN_DEPENDENCY ${WEBKIT_DIR}/WebProcess/Automation/WebAutomationSessionProxy.js
498     DEPENDS ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
499     COMMAND ${CMAKE_COMMAND} -E echo "//# sourceURL=__InjectedScript_WebAutomationSessionProxy.js" > ${WebKit_DERIVED_SOURCES_DIR}/WebAutomationSessionProxy.min.js
500     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py < ${WEBKIT_DIR}/WebProcess/Automation/WebAutomationSessionProxy.js >> ${WebKit_DERIVED_SOURCES_DIR}/WebAutomationSessionProxy.min.js
501     COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl WebAutomationSessionProxyScriptSource ${WebKit_DERIVED_SOURCES_DIR}/WebAutomationSessionProxy.min.js ${WebKit_DERIVED_SOURCES_DIR}/WebAutomationSessionProxyScriptSource.h
502     VERBATIM)
503
504 list(APPEND WebKit_HEADERS
505     ${WebKit_DERIVED_SOURCES_DIR}/WebAutomationSessionProxyScriptSource.h
506 )
507
508 set(WebKit_WEB_PREFERENCES_TEMPLATES
509     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb
510     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb
511     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb
512     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesGetterSetters.cpp.erb
513     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb
514     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb
515     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb
516     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb
517 )
518
519 set(WebKit_WEB_PREFERENCES
520     ${WTF_SCRIPTS_DIR}/Preferences/WebPreferences.yaml
521     ${WTF_SCRIPTS_DIR}/Preferences/WebPreferencesDebug.yaml
522     ${WTF_SCRIPTS_DIR}/Preferences/WebPreferencesExperimental.yaml
523     ${WTF_SCRIPTS_DIR}/Preferences/WebPreferencesInternal.yaml
524 )
525
526 set_source_files_properties(${WebKit_WEB_PREFERENCES} PROPERTIES GENERATED TRUE)
527
528 add_custom_command(
529     OUTPUT ${WebKit_DERIVED_SOURCES_DIR}/WebPageUpdatePreferences.cpp ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesDefinitions.h ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesExperimentalFeatures.cpp ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesGetterSetters.cpp ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesInternalDebugFeatures.cpp ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesKeys.cpp ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesKeys.h ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesStoreDefaultsMap.cpp
530     DEPENDS ${WebKit_WEB_PREFERENCES_TEMPLATES} ${WebKit_WEB_PREFERENCES} WTF_CopyPreferences
531     COMMAND ${RUBY_EXECUTABLE} ${WTF_SCRIPTS_DIR}/GeneratePreferences.rb --frontend WebKit --base ${WTF_SCRIPTS_DIR}/Preferences/WebPreferences.yaml --debug ${WTF_SCRIPTS_DIR}/Preferences/WebPreferencesDebug.yaml --experimental ${WTF_SCRIPTS_DIR}/Preferences/WebPreferencesExperimental.yaml --internal ${WTF_SCRIPTS_DIR}/Preferences/WebPreferencesInternal.yaml --outputDir "${WebKit_DERIVED_SOURCES_DIR}" --template ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb --template ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb --template ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb --template ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesGetterSetters.cpp.erb --template ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb --template ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb --template ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb --template ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb
532     VERBATIM)
533
534 list(APPEND WebKit_HEADERS
535     ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesDefinitions.h
536     ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesKeys.h
537 )
538
539 list(APPEND WebKit_SOURCES
540     ${WebKit_DERIVED_SOURCES_DIR}/WebPageUpdatePreferences.cpp
541     ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesExperimentalFeatures.cpp
542     ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesGetterSetters.cpp
543     ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesInternalDebugFeatures.cpp
544     ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesKeys.cpp
545     ${WebKit_DERIVED_SOURCES_DIR}/WebPreferencesStoreDefaultsMap.cpp
546 )
547
548 list(APPEND WebKit_SOURCES ${WebKit_DERIVED_SOURCES})
549
550 WEBKIT_COMPUTE_SOURCES(WebKit)
551 WEBKIT_FRAMEWORK(WebKit)
552 WEBKIT_FRAMEWORK_TARGET(WebKit)
553 ADD_WEBKIT_PREFIX_HEADER(WebKit)
554
555 list(APPEND WebProcess_PRIVATE_INCLUDE_DIRECTORIES ${WebKit_PRIVATE_INCLUDE_DIRECTORIES})
556 WEBKIT_EXECUTABLE(WebProcess)
557 ADD_WEBKIT_PREFIX_HEADER(WebProcess)
558
559 list(APPEND NetworkProcess_PRIVATE_INCLUDE_DIRECTORIES ${WebKit_PRIVATE_INCLUDE_DIRECTORIES})
560 WEBKIT_EXECUTABLE(NetworkProcess)
561 ADD_WEBKIT_PREFIX_HEADER(NetworkProcess)
562
563 if (ENABLE_GPU_PROCESS)
564     list(APPEND GPUProcess_PRIVATE_INCLUDE_DIRECTORIES ${WebKit_PRIVATE_INCLUDE_DIRECTORIES})
565     WEBKIT_EXECUTABLE(GPUProcess)
566     ADD_WEBKIT_PREFIX_HEADER(GPUProcess)
567 endif ()
568
569 if (ENABLE_PLUGIN_PROCESS)
570     list(APPEND PluginProcess_PRIVATE_INCLUDE_DIRECTORIES ${WebKit_PRIVATE_INCLUDE_DIRECTORIES})
571     WEBKIT_EXECUTABLE(PluginProcess)
572     ADD_WEBKIT_PREFIX_HEADER(PluginProcess)
573 endif ()
574
575 if (COMPILER_IS_GCC_OR_CLANG)
576     WEBKIT_ADD_TARGET_CXX_FLAGS(WebKit -Wno-unused-parameter)
577     WEBKIT_ADD_TARGET_CXX_FLAGS(WebProcess -Wno-unused-parameter)
578     WEBKIT_ADD_TARGET_CXX_FLAGS(NetworkProcess -Wno-unused-parameter)
579     if (ENABLE_GPU_PROCESS)
580         WEBKIT_ADD_TARGET_CXX_FLAGS(GPUProcess -Wno-unused-parameter)
581     endif ()
582     if (ENABLE_PLUGIN_PROCESS)
583         WEBKIT_ADD_TARGET_CXX_FLAGS(PluginProcess -Wno-unused-parameter)
584     endif ()
585 endif ()
586
587 if ("${PORT}" STREQUAL "Mac")
588     WEBKIT_DEFINE_XPC_SERVICES()
589 else ()
590     WEBKIT_POPULATE_LIBRARY_VERSION(WEBKIT)
591
592     set_target_properties(WebKit PROPERTIES VERSION ${WEBKIT_VERSION} SOVERSION ${WEBKIT_VERSION_MAJOR})
593
594     install(TARGETS WebKit WebProcess NetworkProcess
595         LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
596         RUNTIME DESTINATION "${LIBEXEC_INSTALL_DIR}"
597     )
598 endif ()