Add prioritization of ad click conversions and cleaning of sent ad click conversions
[WebKit-https.git] / Source / WebKit / CMakeLists.txt
1 include(WebKitCommon)
2
3 set_property(DIRECTORY . PROPERTY FOLDER "WebKit")
4
5 set(WebKit_INCLUDE_DIRECTORIES
6     "${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}"
7     "${WebKit_FRAMEWORK_HEADERS_DIR}"
8     "${WEBKIT_DIR}"
9     "${WEBKIT_DIR}/NetworkProcess"
10     "${WEBKIT_DIR}/NetworkProcess/Classifier"
11     "${WEBKIT_DIR}/NetworkProcess/Cookies"
12     "${WEBKIT_DIR}/NetworkProcess/CustomProtocols"
13     "${WEBKIT_DIR}/NetworkProcess/Downloads"
14     "${WEBKIT_DIR}/NetworkProcess/FileAPI"
15     "${WEBKIT_DIR}/NetworkProcess/IndexedDB"
16     "${WEBKIT_DIR}/NetworkProcess/ServiceWorker"
17     "${WEBKIT_DIR}/NetworkProcess/cache"
18     "${WEBKIT_DIR}/NetworkProcess/watchos"
19     "${WEBKIT_DIR}/NetworkProcess/webrtc"
20     "${WEBKIT_DIR}/Platform"
21     "${WEBKIT_DIR}/Platform/IPC"
22     "${WEBKIT_DIR}/PluginProcess"
23     "${WEBKIT_DIR}/Shared"
24     "${WEBKIT_DIR}/Shared/API"
25     "${WEBKIT_DIR}/Shared/API/c"
26     "${WEBKIT_DIR}/Shared/ApplePay"
27     "${WEBKIT_DIR}/Shared/Authentication"
28     "${WEBKIT_DIR}/Shared/CoreIPCSupport"
29     "${WEBKIT_DIR}/Shared/Databases"
30     "${WEBKIT_DIR}/Shared/Databases/IndexedDB"
31     "${WEBKIT_DIR}/Shared/FileAPI"
32     "${WEBKIT_DIR}/Shared/Gamepad"
33     "${WEBKIT_DIR}/Shared/Plugins"
34     "${WEBKIT_DIR}/Shared/Plugins/Netscape"
35     "${WEBKIT_DIR}/Shared/Plugins/Netscape/x11"
36     "${WEBKIT_DIR}/Shared/RemoteLayerTree"
37     "${WEBKIT_DIR}/Shared/WebsiteData"
38     "${WEBKIT_DIR}/UIProcess"
39     "${WEBKIT_DIR}/UIProcess/API"
40     "${WEBKIT_DIR}/UIProcess/API/C"
41     "${WEBKIT_DIR}/UIProcess/API/cpp"
42     "${WEBKIT_DIR}/UIProcess/Authentication"
43     "${WEBKIT_DIR}/UIProcess/Automation"
44     "${WEBKIT_DIR}/UIProcess/Downloads"
45     "${WEBKIT_DIR}/UIProcess/Gamepad"
46     "${WEBKIT_DIR}/UIProcess/Launcher"
47     "${WEBKIT_DIR}/UIProcess/Network"
48     "${WEBKIT_DIR}/UIProcess/Network/CustomProtocols"
49     "${WEBKIT_DIR}/UIProcess/Notifications"
50     "${WEBKIT_DIR}/UIProcess/Plugins"
51     "${WEBKIT_DIR}/UIProcess/RemoteLayerTree"
52     "${WEBKIT_DIR}/UIProcess/UserContent"
53     "${WEBKIT_DIR}/UIProcess/WebAuthentication"
54     "${WEBKIT_DIR}/UIProcess/WebAuthentication/Mock"
55     "${WEBKIT_DIR}/UIProcess/WebStorage"
56     "${WEBKIT_DIR}/UIProcess/WebsiteData"
57     "${WEBKIT_DIR}/WebProcess"
58     "${WEBKIT_DIR}/WebProcess/ApplePay"
59     "${WEBKIT_DIR}/WebProcess/ApplicationCache"
60     "${WEBKIT_DIR}/WebProcess/Automation"
61     "${WEBKIT_DIR}/WebProcess/Cache"
62     "${WEBKIT_DIR}/WebProcess/Databases"
63     "${WEBKIT_DIR}/WebProcess/Databases/IndexedDB"
64     "${WEBKIT_DIR}/WebProcess/FileAPI"
65     "${WEBKIT_DIR}/WebProcess/FullScreen"
66     "${WEBKIT_DIR}/WebProcess/Gamepad"
67     "${WEBKIT_DIR}/WebProcess/Geolocation"
68     "${WEBKIT_DIR}/WebProcess/IconDatabase"
69     "${WEBKIT_DIR}/WebProcess/InjectedBundle"
70     "${WEBKIT_DIR}/WebProcess/InjectedBundle/API"
71     "${WEBKIT_DIR}/WebProcess/InjectedBundle/API/c"
72     "${WEBKIT_DIR}/WebProcess/InjectedBundle/DOM"
73     "${WEBKIT_DIR}/WebProcess/Launching"
74     "${WEBKIT_DIR}/WebProcess/MediaCache"
75     "${WEBKIT_DIR}/WebProcess/MediaStream"
76     "${WEBKIT_DIR}/WebProcess/Network"
77     "${WEBKIT_DIR}/WebProcess/Network/webrtc"
78     "${WEBKIT_DIR}/WebProcess/Notifications"
79     "${WEBKIT_DIR}/WebProcess/OriginData"
80     "${WEBKIT_DIR}/WebProcess/Plugins"
81     "${WEBKIT_DIR}/WebProcess/Plugins/Netscape"
82     "${WEBKIT_DIR}/WebProcess/ResourceCache"
83     "${WEBKIT_DIR}/WebProcess/Storage"
84     "${WEBKIT_DIR}/WebProcess/UserContent"
85     "${WEBKIT_DIR}/WebProcess/WebCoreSupport"
86     "${WEBKIT_DIR}/WebProcess/WebPage"
87     "${WEBKIT_DIR}/WebProcess/WebPage/RemoteLayerTree"
88     "${WEBKIT_DIR}/WebProcess/WebStorage"
89     "${DERIVED_SOURCES_WEBKIT_DIR}"
90     "${DERIVED_SOURCES_WEBKIT_DIR}/include"
91     "${CMAKE_SOURCE_DIR}/Source"
92     "${CMAKE_SOURCE_DIR}/WebKitLibraries"
93 )
94
95 set(PROTOCOL_GENERATOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
96
97 set(WebKit_SYSTEM_INCLUDE_DIRECTORIES
98     ${ICU_INCLUDE_DIRS}
99 )
100
101 list(APPEND WebKit_UNIFIED_SOURCE_LIST_FILES
102     "Sources.txt"
103 )
104
105 set(WebKit_MESSAGES_IN_FILES
106     NetworkProcess/Cookies/WebCookieManager.messages.in
107
108     NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in
109
110     NetworkProcess/NetworkConnectionToWebProcess.messages.in
111     NetworkProcess/NetworkContentRuleListManager.messages.in
112     NetworkProcess/NetworkProcess.messages.in
113     NetworkProcess/NetworkResourceLoader.messages.in
114     NetworkProcess/NetworkSocketStream.messages.in
115
116     NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in
117     NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in
118     NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in
119
120     NetworkProcess/cache/CacheStorageEngineConnection.messages.in
121
122     NetworkProcess/webrtc/NetworkMDNSRegister.messages.in
123     NetworkProcess/webrtc/NetworkRTCMonitor.messages.in
124     NetworkProcess/webrtc/NetworkRTCProvider.messages.in
125     NetworkProcess/webrtc/NetworkRTCSocket.messages.in
126
127     PluginProcess/PluginControllerProxy.messages.in
128     PluginProcess/PluginProcess.messages.in
129     PluginProcess/WebProcessConnection.messages.in
130
131     Shared/AuxiliaryProcess.messages.in
132     Shared/WebConnection.messages.in
133
134     Shared/Authentication/AuthenticationManager.messages.in
135
136     Shared/Plugins/NPObjectMessageReceiver.messages.in
137
138     UIProcess/DrawingAreaProxy.messages.in
139     UIProcess/RemoteWebInspectorProxy.messages.in
140     UIProcess/VisitedLinkStore.messages.in
141     UIProcess/WebCookieManagerProxy.messages.in
142     UIProcess/WebFullScreenManagerProxy.messages.in
143     UIProcess/WebGeolocationManagerProxy.messages.in
144     UIProcess/WebInspectorProxy.messages.in
145     UIProcess/WebPageProxy.messages.in
146     UIProcess/WebPasteboardProxy.messages.in
147     UIProcess/WebProcessPool.messages.in
148     UIProcess/WebProcessProxy.messages.in
149
150     UIProcess/Automation/WebAutomationSession.messages.in
151
152     UIProcess/Downloads/DownloadProxy.messages.in
153
154     UIProcess/Network/NetworkProcessProxy.messages.in
155
156     UIProcess/Plugins/PluginProcessProxy.messages.in
157
158     UIProcess/UserContent/WebUserContentControllerProxy.messages.in
159
160     UIProcess/WebStorage/StorageManager.messages.in
161
162     WebProcess/WebProcess.messages.in
163
164     WebProcess/Automation/WebAutomationSessionProxy.messages.in
165
166     WebProcess/Cache/WebCacheStorageConnection.messages.in
167
168     WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in
169
170     WebProcess/FullScreen/WebFullScreenManager.messages.in
171
172     WebProcess/Geolocation/WebGeolocationManager.messages.in
173
174     WebProcess/Network/webrtc/WebMDNSRegister.messages.in
175     WebProcess/Network/webrtc/WebRTCMonitor.messages.in
176     WebProcess/Network/webrtc/WebRTCResolver.messages.in
177     WebProcess/Network/webrtc/WebRTCSocket.messages.in
178
179     WebProcess/Network/NetworkProcessConnection.messages.in
180     WebProcess/Network/WebResourceLoader.messages.in
181     WebProcess/Network/WebSocketStream.messages.in
182
183     WebProcess/Notifications/WebNotificationManager.messages.in
184
185     WebProcess/Plugins/PluginProcessConnection.messages.in
186     WebProcess/Plugins/PluginProcessConnectionManager.messages.in
187     WebProcess/Plugins/PluginProxy.messages.in
188
189     WebProcess/Storage/ServiceWorkerClientFetch.messages.in
190     WebProcess/Storage/WebSWClientConnection.messages.in
191     WebProcess/Storage/WebSWContextManagerConnection.messages.in
192
193     WebProcess/UserContent/WebUserContentController.messages.in
194
195     WebProcess/WebPage/DrawingArea.messages.in
196     WebProcess/WebPage/EventDispatcher.messages.in
197     WebProcess/WebPage/RemoteWebInspectorUI.messages.in
198     WebProcess/WebPage/VisitedLinkTableController.messages.in
199     WebProcess/WebPage/WebInspector.messages.in
200     WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in
201     WebProcess/WebPage/WebInspectorUI.messages.in
202     WebProcess/WebPage/WebPage.messages.in
203
204     WebProcess/WebStorage/StorageAreaMap.messages.in
205 )
206
207 if (${WebCore_LIBRARY_TYPE} STREQUAL STATIC)
208     # Link with WebCore as PRIVATE not to propagate WebCore to all users of WebKit.
209     set(WebKit_LIBRARIES
210         PRIVATE WebCore
211         PUBLIC WebCoreHeaderInterface
212     )
213 else ()
214     # All users of WebKit need to link WebCore if WebCore is a shared library.
215     set(WebKit_LIBRARIES PUBLIC WebCore)
216 endif ()
217
218 set(WebProcess_LIBRARIES
219     WebKit
220 )
221
222 set(NetworkProcess_LIBRARIES
223     WebKit
224 )
225
226 set(PluginProcess_LIBRARIES
227     WebKit
228 )
229
230 if (ENABLE_GRAPHICS_CONTEXT_3D)
231     # For platforms that want to use system-provided OpenGL (ES) / EGL headers,
232     # these include directories, libraries or definitions need to be
233     # added before the ANGLE directories.
234     if (USE_LIBEPOXY)
235         list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
236             ${LIBEPOXY_INCLUDE_DIRS}
237         )
238         list(APPEND WebKit_LIBRARIES
239             PRIVATE ${LIBEPOXY_LIBRARIES}
240         )
241         add_definitions(${LIBEPOXY_DEFINITIONS})
242     else ()
243         if (USE_OPENGL)
244             list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
245                 ${OPENGL_INCLUDE_DIRS}
246             )
247             list(APPEND WebKit_LIBRARIES
248                 PRIVATE ${OPENGL_LIBRARIES}
249             )
250             add_definitions(${OPENGL_DEFINITIONS})
251         elseif (USE_OPENGL_ES)
252             list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
253                 ${OPENGLES2_INCLUDE_DIRS}
254             )
255             list(APPEND WebKit_LIBRARIES
256                 PRIVATE ${OPENGLES2_LIBRARIES}
257             )
258             add_definitions(${OPENGLES2_DEFINITIONS})
259         endif ()
260
261         if (USE_EGL)
262             list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
263                 ${EGL_INCLUDE_DIRS}
264             )
265             list(APPEND WebKit_LIBRARIES
266                 PRIVATE ${EGL_LIBRARIES}
267             )
268             add_definitions(${EGL_DEFINITIONS})
269         endif ()
270     endif ()
271
272     list(APPEND WebKit_INCLUDE_DIRECTORIES
273         "${THIRDPARTY_DIR}/ANGLE"
274         "${THIRDPARTY_DIR}/ANGLE/include/KHR"
275     )
276 endif ()
277
278 if (ATOMIC_INT64_REQUIRES_LIBATOMIC)
279     list(APPEND WebKit_LIBRARIES PRIVATE atomic)
280 endif ()
281
282 if (UNIX)
283     check_function_exists(shm_open SHM_OPEN_EXISTS)
284     if (NOT SHM_OPEN_EXISTS)
285         set(CMAKE_REQUIRED_LIBRARIES rt)
286         check_function_exists(shm_open SHM_OPEN_REQUIRES_LIBRT)
287         if (SHM_OPEN_REQUIRES_LIBRT)
288             list(APPEND WebKit_LIBRARIES PRIVATE rt)
289         endif ()
290         unset(CMAKE_REQUIRED_LIBRARIES)
291     endif ()
292 endif ()
293
294 macro(ADD_WEBKIT_PREFIX_HEADER _target)
295     if (WebKit_USE_PREFIX_HEADER)
296         get_target_property(OLD_COMPILE_FLAGS ${_target} COMPILE_FLAGS)
297         if (${OLD_COMPILE_FLAGS} STREQUAL "OLD_COMPILE_FLAGS-NOTFOUND")
298             set(OLD_COMPILE_FLAGS "")
299         endif ()
300         set_target_properties(${_target} PROPERTIES COMPILE_FLAGS "${OLD_COMPILE_FLAGS} -include ${WEBKIT_DIR}/WebKit2Prefix.h")
301     endif ()
302 endmacro()
303
304 set(WebKit_AUTOMATION_PROTOCOL_GENERATOR_EXTRA_FLAGS
305 )
306
307 WEBKIT_FRAMEWORK_DECLARE(WebKit)
308 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
309
310 # Helper macro which wraps generate-message-receiver.py and generate-message-header.py scripts
311 #   _output_source is a list name which will contain generated sources.(eg. WebKit_SOURCES)
312 #   _input_files are messages.in files to generate.
313 macro(GENERATE_MESSAGE_SOURCES _output_source _input_files)
314     foreach (_file ${_input_files})
315         get_filename_component(_name ${_file} NAME_WE)
316         add_custom_command(
317             OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/${_name}MessageReceiver.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/${_name}Messages.h
318             MAIN_DEPENDENCY ${_file}
319             DEPENDS ${WEBKIT_DIR}/Scripts/webkit/__init__.py
320                     ${WEBKIT_DIR}/Scripts/webkit/messages.py
321                     ${WEBKIT_DIR}/Scripts/webkit/model.py
322                     ${WEBKIT_DIR}/Scripts/webkit/parser.py
323             COMMAND ${PYTHON_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-message-receiver.py ${_file} > ${DERIVED_SOURCES_WEBKIT_DIR}/${_name}MessageReceiver.cpp
324             COMMAND ${PYTHON_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-messages-header.py ${_file} > ${DERIVED_SOURCES_WEBKIT_DIR}/${_name}Messages.h
325             WORKING_DIRECTORY ${WEBKIT_DIR}
326             VERBATIM)
327
328         list(APPEND ${_output_source} ${DERIVED_SOURCES_WEBKIT_DIR}/${_name}MessageReceiver.cpp)
329     endforeach ()
330 endmacro()
331 GENERATE_MESSAGE_SOURCES(WebKit_DERIVED_SOURCES "${WebKit_MESSAGES_IN_FILES}")
332
333 set(WebKit_AUTOMATION_PROTOCOL_GENERATOR_SCRIPTS
334     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py
335     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/cpp_generator.py
336     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/cpp_generator_templates.py
337     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_header.py
338     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_implementation.py
339     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_header.py
340     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_implementation.py
341     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_header.py
342     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_implementation.py
343     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generator.py
344     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/generator_templates.py
345     ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/codegen/models.py
346 )
347
348 set(WebKit_AUTOMATION_PROTOCOL_GENERATOR_INPUTS
349     ${WEBKIT_DIR}/UIProcess/Automation/Automation.json
350 )
351
352 add_custom_command(
353     OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationBackendDispatchers.h ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationBackendDispatchers.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationProtocolObjects.h ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationProtocolObjects.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationFrontendDispatchers.h ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationFrontendDispatchers.cpp
354     MAIN_DEPENDENCY ${WebKit_AUTOMATION_PROTOCOL_GENERATOR_INPUTS}
355     DEPENDS ${WebKit_AUTOMATION_PROTOCOL_GENERATOR_SCRIPTS}
356     COMMAND ${PYTHON_EXECUTABLE} ${PROTOCOL_GENERATOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py --outputDir "${DERIVED_SOURCES_WEBKIT_DIR}" --framework WebKit ${WebKit_AUTOMATION_PROTOCOL_GENERATOR_EXTRA_FLAGS} --backend ${WebKit_AUTOMATION_PROTOCOL_GENERATOR_INPUTS}
357     VERBATIM)
358
359 list(APPEND WebKit_HEADERS
360     ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationBackendDispatchers.h
361     ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationFrontendDispatchers.h
362     ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationProtocolObjects.h
363 )
364
365 list(APPEND WebKit_SOURCES
366     ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationBackendDispatchers.cpp
367     ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationFrontendDispatchers.cpp
368     ${DERIVED_SOURCES_WEBKIT_DIR}/AutomationProtocolObjects.cpp
369 )
370
371 add_custom_command(
372     OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxyScriptSource.h ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxy.min.js
373     MAIN_DEPENDENCY ${WEBKIT_DIR}/WebProcess/Automation/WebAutomationSessionProxy.js
374     DEPENDS ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
375     COMMAND ${CMAKE_COMMAND} -E echo "//# sourceURL=__InjectedScript_WebAutomationSessionProxy.js" > ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxy.min.js
376     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py < ${WEBKIT_DIR}/WebProcess/Automation/WebAutomationSessionProxy.js >> ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxy.min.js
377     COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl WebAutomationSessionProxyScriptSource ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxy.min.js ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxyScriptSource.h
378     VERBATIM)
379
380 list(APPEND WebKit_HEADERS
381     ${DERIVED_SOURCES_WEBKIT_DIR}/WebAutomationSessionProxyScriptSource.h
382 )
383
384 set(WebKit_WEB_PREFERENCES_TEMPLATES
385     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb
386     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb
387     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb
388     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb
389     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb
390     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb
391     ${WEBKIT_DIR}/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb
392 )
393
394 add_custom_command(
395     OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/WebPageUpdatePreferences.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesDefinitions.h ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesExperimentalFeatures.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesInternalDebugFeatures.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.cpp ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.h ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesStoreDefaultsMap.cpp
396     MAIN_DEPENDENCY ${WEBKIT_DIR}/Shared/WebPreferences.yaml
397     DEPENDS ${WebKit_WEB_PREFERENCES_TEMPLATES}
398     COMMAND ${RUBY_EXECUTABLE} ${WEBKIT_DIR}/Scripts/GeneratePreferences.rb --input ${WEBKIT_DIR}/Shared/WebPreferences.yaml --outputDir "${DERIVED_SOURCES_WEBKIT_DIR}"
399     VERBATIM)
400
401 list(APPEND WebKit_HEADERS
402     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesDefinitions.h
403     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.h
404 )
405
406 list(APPEND WebKit_SOURCES
407     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPageUpdatePreferences.cpp
408     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesExperimentalFeatures.cpp
409     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesInternalDebugFeatures.cpp
410     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesKeys.cpp
411     ${DERIVED_SOURCES_WEBKIT_DIR}/WebPreferencesStoreDefaultsMap.cpp
412 )
413
414
415 list(APPEND WebKit_SOURCES ${WebKit_DERIVED_SOURCES})
416
417 WEBKIT_COMPUTE_SOURCES(WebKit)
418
419 WEBKIT_FRAMEWORK(WebKit)
420 add_dependencies(WebKit WebCore ${WEBKIT_EXTRA_DEPENDENCIES})
421 ADD_WEBKIT_PREFIX_HEADER(WebKit)
422
423 add_executable(WebProcess ${WebProcess_SOURCES})
424 ADD_WEBKIT_PREFIX_HEADER(WebProcess)
425 target_link_libraries(WebProcess ${WebProcess_LIBRARIES})
426
427 if (WebKit_WebProcess_OUTPUT_NAME)
428     set_target_properties(WebProcess PROPERTIES OUTPUT_NAME ${WebKit_WebProcess_OUTPUT_NAME})
429 endif ()
430
431 add_executable(NetworkProcess ${NetworkProcess_SOURCES})
432 ADD_WEBKIT_PREFIX_HEADER(NetworkProcess)
433 target_link_libraries(NetworkProcess ${NetworkProcess_LIBRARIES})
434
435 if (WebKit_NetworkProcess_OUTPUT_NAME)
436     set_target_properties(NetworkProcess PROPERTIES OUTPUT_NAME ${WebKit_NetworkProcess_OUTPUT_NAME})
437 endif ()
438
439 if (COMPILER_IS_GCC_OR_CLANG)
440     WEBKIT_ADD_TARGET_CXX_FLAGS(WebKit -Wno-unused-parameter)
441     WEBKIT_ADD_TARGET_CXX_FLAGS(WebProcess -Wno-unused-parameter)
442     WEBKIT_ADD_TARGET_CXX_FLAGS(NetworkProcess -Wno-unused-parameter)
443 endif ()
444
445 # FIXME: Mac should build a plugin process.
446 if (ENABLE_PLUGIN_PROCESS AND NOT "${PORT}" STREQUAL "Mac")
447     add_definitions(-DENABLE_PLUGIN_PROCESS=1)
448     add_executable(PluginProcess ${PluginProcess_SOURCES})
449     ADD_WEBKIT_PREFIX_HEADER(PluginProcess)
450     target_link_libraries(PluginProcess ${PluginProcess_LIBRARIES})
451     install(TARGETS PluginProcess DESTINATION "${LIBEXEC_INSTALL_DIR}")
452
453     if (COMPILER_IS_GCC_OR_CLANG)
454         WEBKIT_ADD_TARGET_CXX_FLAGS(PluginProcess -Wno-unused-parameter)
455     endif ()
456
457     if (WebKit_PluginProcess_OUTPUT_NAME)
458       set_target_properties(PluginProcess PROPERTIES OUTPUT_NAME ${WebKit_PluginProcess_OUTPUT_NAME})
459     endif ()
460 endif ()
461
462 if ("${PORT}" STREQUAL "Mac")
463     WEBKIT_DEFINE_XPC_SERVICES()
464 else ()
465     WEBKIT_POPULATE_LIBRARY_VERSION(WEBKIT)
466
467     set_target_properties(WebKit PROPERTIES VERSION ${WEBKIT_VERSION} SOVERSION ${WEBKIT_VERSION_MAJOR})
468
469     install(TARGETS WebKit WebProcess NetworkProcess
470         LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
471         RUNTIME DESTINATION "${LIBEXEC_INSTALL_DIR}"
472     )
473 endif ()