Use a 1-byte enum class for TextDirection
[WebKit-https.git] / Source / WebKitLegacy / PlatformMac.cmake
1 find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices)
2 find_library(QUARTZ_LIBRARY Quartz)
3 add_definitions(-iframework ${QUARTZ_LIBRARY}/Frameworks)
4 add_definitions(-iframework ${APPLICATIONSERVICES_LIBRARY}/Versions/Current/Frameworks)
5
6 list(APPEND WebKitLegacy_INCLUDE_DIRECTORIES
7     "${DERIVED_SOURCES_WEBKITLEGACY_DIR}"
8     "${CMAKE_SOURCE_DIR}/WebKitLibraries"
9 )
10
11 list(APPEND WebKitLegacy_SYSTEM_INCLUDE_DIRECTORIES
12     mac
13     mac/Carbon
14     mac/DefaultDelegates
15     mac/DOM
16     mac/History
17     mac/icu
18     mac/Misc
19     mac/Panels
20     mac/Plugins
21     mac/Plugins/Hosted
22     mac/Storage
23     mac/WebCoreSupport
24     mac/WebInspector
25     mac/WebView
26 )
27
28 list(APPEND WebKitLegacy_SOURCES
29     cf/WebCoreSupport/WebInspectorClientCF.cpp
30
31     mac/Carbon/CarbonUtils.m
32     mac/Carbon/CarbonWindowAdapter.mm
33     mac/Carbon/CarbonWindowContentView.m
34     mac/Carbon/CarbonWindowFrame.m
35     mac/Carbon/HIViewAdapter.m
36     mac/Carbon/HIWebView.mm
37
38     mac/DOM/DOM.mm
39     mac/DOM/DOMAbstractView.mm
40     mac/DOM/DOMAttr.mm
41     mac/DOM/DOMBlob.mm
42     mac/DOM/DOMCDATASection.mm
43     mac/DOM/DOMCharacterData.mm
44     mac/DOM/DOMComment.mm
45     mac/DOM/DOMCounter.mm
46     mac/DOM/DOMCSS.mm
47     mac/DOM/DOMCSSCharsetRule.mm
48     mac/DOM/DOMCSSFontFaceRule.mm
49     mac/DOM/DOMCSSImportRule.mm
50     mac/DOM/DOMCSSMediaRule.mm
51     mac/DOM/DOMCSSPageRule.mm
52     mac/DOM/DOMCSSPrimitiveValue.mm
53     mac/DOM/DOMCSSRule.mm
54     mac/DOM/DOMCSSRuleList.mm
55     mac/DOM/DOMCSSStyleDeclaration.mm
56     mac/DOM/DOMCSSStyleRule.mm
57     mac/DOM/DOMCSSStyleSheet.mm
58     mac/DOM/DOMCSSUnknownRule.mm
59     mac/DOM/DOMCSSValue.mm
60     mac/DOM/DOMCSSValueList.mm
61     mac/DOM/DOMCustomXPathNSResolver.mm
62     mac/DOM/DOMDocument.mm
63     mac/DOM/DOMDocumentFragment.mm
64     mac/DOM/DOMDocumentType.mm
65     mac/DOM/DOMElement.mm
66     mac/DOM/DOMEntityReference.mm
67     mac/DOM/DOMEvent.mm
68     mac/DOM/DOMEvents.mm
69     mac/DOM/DOMFile.mm
70     mac/DOM/DOMFileList.mm
71     mac/DOM/DOMHTML.mm
72     mac/DOM/DOMHTMLAnchorElement.mm
73     mac/DOM/DOMHTMLAppletElement.mm
74     mac/DOM/DOMHTMLAreaElement.mm
75     mac/DOM/DOMHTMLBRElement.mm
76     mac/DOM/DOMHTMLBaseElement.mm
77     mac/DOM/DOMHTMLBaseFontElement.mm
78     mac/DOM/DOMHTMLBodyElement.mm
79     mac/DOM/DOMHTMLButtonElement.mm
80     mac/DOM/DOMHTMLCanvasElement.mm
81     mac/DOM/DOMHTMLCollection.mm
82     mac/DOM/DOMHTMLDListElement.mm
83     mac/DOM/DOMHTMLDirectoryElement.mm
84     mac/DOM/DOMHTMLDivElement.mm
85     mac/DOM/DOMHTMLDocument.mm
86     mac/DOM/DOMHTMLElement.mm
87     mac/DOM/DOMHTMLEmbedElement.mm
88     mac/DOM/DOMHTMLFieldSetElement.mm
89     mac/DOM/DOMHTMLFontElement.mm
90     mac/DOM/DOMHTMLFormElement.mm
91     mac/DOM/DOMHTMLFrameElement.mm
92     mac/DOM/DOMHTMLFrameSetElement.mm
93     mac/DOM/DOMHTMLHRElement.mm
94     mac/DOM/DOMHTMLHeadElement.mm
95     mac/DOM/DOMHTMLHeadingElement.mm
96     mac/DOM/DOMHTMLHtmlElement.mm
97     mac/DOM/DOMHTMLIFrameElement.mm
98     mac/DOM/DOMHTMLImageElement.mm
99     mac/DOM/DOMHTMLInputElement.mm
100     mac/DOM/DOMHTMLLIElement.mm
101     mac/DOM/DOMHTMLLabelElement.mm
102     mac/DOM/DOMHTMLLegendElement.mm
103     mac/DOM/DOMHTMLLinkElement.mm
104     mac/DOM/DOMHTMLMapElement.mm
105     mac/DOM/DOMHTMLMarqueeElement.mm
106     mac/DOM/DOMHTMLMediaElement.mm
107     mac/DOM/DOMHTMLMenuElement.mm
108     mac/DOM/DOMHTMLMetaElement.mm
109     mac/DOM/DOMHTMLModElement.mm
110     mac/DOM/DOMHTMLOListElement.mm
111     mac/DOM/DOMHTMLObjectElement.mm
112     mac/DOM/DOMHTMLOptGroupElement.mm
113     mac/DOM/DOMHTMLOptionElement.mm
114     mac/DOM/DOMHTMLOptionsCollection.mm
115     mac/DOM/DOMHTMLParagraphElement.mm
116     mac/DOM/DOMHTMLParamElement.mm
117     mac/DOM/DOMHTMLPreElement.mm
118     mac/DOM/DOMHTMLQuoteElement.mm
119     mac/DOM/DOMHTMLScriptElement.mm
120     mac/DOM/DOMHTMLSelectElement.mm
121     mac/DOM/DOMHTMLStyleElement.mm
122     mac/DOM/DOMHTMLTableCaptionElement.mm
123     mac/DOM/DOMHTMLTableCellElement.mm
124     mac/DOM/DOMHTMLTableColElement.mm
125     mac/DOM/DOMHTMLTableElement.mm
126     mac/DOM/DOMHTMLTableRowElement.mm
127     mac/DOM/DOMHTMLTableSectionElement.mm
128     mac/DOM/DOMHTMLTextAreaElement.mm
129     mac/DOM/DOMHTMLTitleElement.mm
130     mac/DOM/DOMHTMLUListElement.mm
131     mac/DOM/DOMHTMLVideoElement.mm
132     mac/DOM/DOMInternal.mm
133     mac/DOM/DOMImplementation.mm
134     mac/DOM/DOMKeyboardEvent.mm
135     mac/DOM/DOMMediaError.mm
136     mac/DOM/DOMMediaList.mm
137     mac/DOM/DOMMouseEvent.mm
138     mac/DOM/DOMMutationEvent.mm
139     mac/DOM/DOMNamedNodeMap.mm
140     mac/DOM/DOMNode.mm
141     mac/DOM/DOMNodeIterator.mm
142     mac/DOM/DOMNodeList.mm
143     mac/DOM/DOMObject.mm
144     mac/DOM/DOMOverflowEvent.mm
145     mac/DOM/DOMProcessingInstruction.mm
146     mac/DOM/DOMProgressEvent.mm
147     mac/DOM/DOMRGBColor.mm
148     mac/DOM/DOMRange.mm
149     mac/DOM/DOMRect.mm
150     mac/DOM/DOMStyleSheet.mm
151     mac/DOM/DOMStyleSheetList.mm
152     mac/DOM/DOMText.mm
153     mac/DOM/DOMTextEvent.mm
154     mac/DOM/DOMTimeRanges.mm
155     mac/DOM/DOMTokenList.mm
156     mac/DOM/DOMTreeWalker.mm
157     mac/DOM/DOMUIEvent.mm
158     mac/DOM/DOMUIKitExtensions.mm
159     mac/DOM/DOMUtility.mm
160     mac/DOM/DOMWheelEvent.mm
161     mac/DOM/DOMXPath.mm
162     mac/DOM/DOMXPathExpression.mm
163     mac/DOM/DOMXPathResult.mm
164     mac/DOM/ExceptionHandlers.mm
165     mac/DOM/ObjCEventListener.mm
166     mac/DOM/ObjCNodeFilterCondition.mm
167
168     mac/DefaultDelegates/WebDefaultContextMenuDelegate.mm
169     mac/DefaultDelegates/WebDefaultEditingDelegate.m
170     mac/DefaultDelegates/WebDefaultPolicyDelegate.m
171     mac/DefaultDelegates/WebDefaultUIDelegate.mm
172
173     mac/History/BackForwardList.mm
174     mac/History/BinaryPropertyList.cpp
175     mac/History/HistoryPropertyList.mm
176     mac/History/WebBackForwardList.mm
177     mac/History/WebHistory.mm
178     mac/History/WebHistoryItem.mm
179     mac/History/WebURLsWithTitles.m
180
181     mac/Misc/WebCache.mm
182     mac/Misc/WebCoreStatistics.mm
183     mac/Misc/WebDownload.mm
184     mac/Misc/WebElementDictionary.mm
185     mac/Misc/WebIconDatabase.mm
186     mac/Misc/WebKitErrors.m
187     mac/Misc/WebKitLogging.m
188     mac/Misc/WebKitNSStringExtras.mm
189     mac/Misc/WebKitStatistics.m
190     mac/Misc/WebKitVersionChecks.mm
191     mac/Misc/WebLocalizableStrings.mm
192     mac/Misc/WebLocalizableStringsInternal.mm
193     mac/Misc/WebNSControlExtras.m
194     mac/Misc/WebNSDataExtras.mm
195     mac/Misc/WebNSDictionaryExtras.m
196     mac/Misc/WebNSEventExtras.m
197     mac/Misc/WebNSFileManagerExtras.mm
198     mac/Misc/WebNSImageExtras.m
199     mac/Misc/WebNSObjectExtras.mm
200     mac/Misc/WebNSPasteboardExtras.mm
201     mac/Misc/WebNSPrintOperationExtras.m
202     mac/Misc/WebNSURLExtras.mm
203     mac/Misc/WebNSURLRequestExtras.m
204     mac/Misc/WebNSUserDefaultsExtras.mm
205     mac/Misc/WebNSViewExtras.m
206     mac/Misc/WebNSWindowExtras.m
207     mac/Misc/WebSharingServicePickerController.mm
208     mac/Misc/WebStringTruncator.mm
209     mac/Misc/WebUserContentURLPattern.mm
210
211     mac/Panels/WebAuthenticationPanel.m
212     mac/Panels/WebPanelAuthenticationHandler.m
213
214     mac/Plugins/WebBaseNetscapePluginView.mm
215     mac/Plugins/WebBasePluginPackage.mm
216     mac/Plugins/WebNetscapePluginEventHandler.mm
217     mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm
218     mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm
219     mac/Plugins/WebNetscapePluginPackage.mm
220     mac/Plugins/WebNetscapePluginStream.mm
221     mac/Plugins/WebNetscapePluginView.mm
222     mac/Plugins/WebPluginContainerCheck.mm
223     mac/Plugins/WebPluginController.mm
224     mac/Plugins/WebPluginDatabase.mm
225     mac/Plugins/WebPluginPackage.mm
226     mac/Plugins/WebPluginRequest.m
227     mac/Plugins/npapi.mm
228
229     mac/Plugins/Hosted/HostedNetscapePluginStream.mm
230     mac/Plugins/Hosted/NetscapePluginHostManager.mm
231     mac/Plugins/Hosted/NetscapePluginHostProxy.mm
232     mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
233     mac/Plugins/Hosted/ProxyInstance.mm
234     mac/Plugins/Hosted/ProxyRuntimeObject.mm
235     mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
236     mac/Plugins/Hosted/WebKitPluginAgent.defs
237     mac/Plugins/Hosted/WebKitPluginAgentReply.defs
238     mac/Plugins/Hosted/WebKitPluginClient.defs
239     mac/Plugins/Hosted/WebKitPluginHost.defs
240     mac/Plugins/Hosted/WebKitPluginHostTypes.defs
241     mac/Plugins/Hosted/WebTextInputWindowController.m
242
243     mac/Storage/WebDatabaseManager.mm
244     mac/Storage/WebDatabaseManagerClient.mm
245     mac/Storage/WebDatabaseProvider.mm
246     mac/Storage/WebDatabaseQuotaManager.mm
247     mac/Storage/WebStorageManager.mm
248     mac/Storage/WebStorageTrackerClient.mm
249
250     mac/WebCoreSupport/CorrectionPanel.mm
251     mac/WebCoreSupport/PopupMenuMac.mm
252     mac/WebCoreSupport/SearchPopupMenuMac.mm
253     mac/WebCoreSupport/WebAlternativeTextClient.mm
254     mac/WebCoreSupport/WebApplicationCache.mm
255     mac/WebCoreSupport/WebApplicationCacheQuotaManager.mm
256     mac/WebCoreSupport/WebChromeClient.mm
257     mac/WebCoreSupport/WebContextMenuClient.mm
258     mac/WebCoreSupport/WebDeviceOrientationClient.mm
259     mac/WebCoreSupport/WebDragClient.mm
260     mac/WebCoreSupport/WebEditorClient.mm
261     mac/WebCoreSupport/WebFrameLoaderClient.mm
262     mac/WebCoreSupport/WebFrameNetworkingContext.mm
263     mac/WebCoreSupport/WebGeolocationClient.mm
264     mac/WebCoreSupport/WebInspectorClient.mm
265     mac/WebCoreSupport/WebJavaScriptTextInputPanel.m
266     mac/WebCoreSupport/WebKitFullScreenListener.mm
267     mac/WebCoreSupport/WebNotificationClient.mm
268     mac/WebCoreSupport/WebOpenPanelResultListener.mm
269     mac/WebCoreSupport/WebPlatformStrategies.mm
270     mac/WebCoreSupport/WebPluginInfoProvider.mm
271     mac/WebCoreSupport/WebProgressTrackerClient.mm
272     mac/WebCoreSupport/WebSecurityOrigin.mm
273     mac/WebCoreSupport/WebSelectionServiceController.mm
274     mac/WebCoreSupport/WebUserMediaClient.mm
275     mac/WebCoreSupport/WebValidationMessageClient.mm
276     mac/WebCoreSupport/WebVisitedLinkStore.mm
277
278     mac/WebInspector/WebInspector.mm
279     mac/WebInspector/WebInspectorFrontend.mm
280     mac/WebInspector/WebNodeHighlight.mm
281     mac/WebInspector/WebNodeHighlightView.mm
282     mac/WebInspector/WebNodeHighlighter.mm
283
284     mac/WebView/WebArchive.mm
285     mac/WebView/WebClipView.mm
286     mac/WebView/WebDashboardRegion.mm
287     mac/WebView/WebDataSource.mm
288     mac/WebView/WebDelegateImplementationCaching.mm
289     mac/WebView/WebDeviceOrientation.mm
290     mac/WebView/WebDeviceOrientationProviderMock.mm
291     mac/WebView/WebDocumentLoaderMac.mm
292     mac/WebView/WebDynamicScrollBarsView.mm
293     mac/WebView/WebFormDelegate.m
294     mac/WebView/WebFrame.mm
295     mac/WebView/WebFrameView.mm
296     mac/WebView/WebFullScreenController.mm
297     mac/WebView/WebGeolocationPosition.mm
298     mac/WebView/WebHTMLRepresentation.mm
299     mac/WebView/WebHTMLView.mm
300     mac/WebView/WebImmediateActionController.mm
301     mac/WebView/WebIndicateLayer.mm
302     mac/WebView/WebJSPDFDoc.mm
303     mac/WebView/WebNavigationData.mm
304     mac/WebView/WebNotification.mm
305     mac/WebView/WebPDFDocumentExtras.mm
306     mac/WebView/WebPDFRepresentation.mm
307     mac/WebView/WebPDFView.mm
308     mac/WebView/WebPolicyDelegate.mm
309     mac/WebView/WebPreferences.mm
310     mac/WebView/WebResource.mm
311     mac/WebView/WebScriptDebugDelegate.mm
312     mac/WebView/WebScriptDebugger.mm
313     mac/WebView/WebScriptWorld.mm
314     mac/WebView/WebTextCompletionController.mm
315     mac/WebView/WebTextIterator.mm
316     mac/WebView/WebView.mm
317     mac/WebView/WebViewData.mm
318 )
319
320 set(WebKitLegacy_FORWARDING_HEADERS_DIRECTORIES
321     mac/DOM
322     mac/DefaultDelegates
323     mac/History
324     mac/Misc
325     mac/Panels
326     mac/Plugins
327     mac/Storage
328     mac/WebCoreSupport
329     mac/WebInspector
330     mac/WebView
331 )
332
333 set(WebKitLegacy_FORWARDING_HEADERS_FILES
334     mac/DOM/WebDOMOperations.h
335
336     mac/History/WebHistory.h
337     mac/History/WebHistoryItem.h
338
339     mac/Misc/WebNSURLExtras.h
340
341     mac/Panels/WebPanelAuthenticationHandler.h
342
343     mac/Plugins/WebBasePluginPackage.h
344
345     mac/Storage/WebDatabaseManagerPrivate.h
346
347     mac/WebCoreSupport/WebKeyGenerator.h
348
349     mac/WebInspector/WebInspector.h
350
351     mac/WebView/WebFrame.h
352     mac/WebView/WebView.h
353
354     ${WEBCORE_DIR}/plugins/npfunctions.h
355 )
356
357 add_definitions("-include WebKitPrefix.h")
358
359 set(C99_FILES
360     ${WEBKITLEGACY_DIR}/mac/Carbon/CarbonUtils.m
361     ${WEBKITLEGACY_DIR}/mac/Carbon/CarbonWindowContentView.m
362     ${WEBKITLEGACY_DIR}/mac/Carbon/CarbonWindowFrame.m
363     ${WEBKITLEGACY_DIR}/mac/Carbon/HIViewAdapter.m
364
365     mac/DefaultDelegates/WebDefaultEditingDelegate.m
366     mac/DefaultDelegates/WebDefaultPolicyDelegate.m
367     mac/DefaultDelegates/WebDefaultUIDelegate.m
368
369     mac/Misc/WebKitErrors.m
370     mac/Misc/WebKitLogging.m
371     mac/Misc/WebKitStatistics.m
372     mac/Misc/WebKitSystemBits.m
373     mac/Misc/WebNSArrayExtras.m
374     mac/Misc/WebNSControlExtras.m
375     mac/Misc/WebNSDictionaryExtras.m
376     mac/Misc/WebNSEventExtras.m
377     mac/Misc/WebNSImageExtras.m
378     mac/Misc/WebNSPrintOperationExtras.m
379     mac/Misc/WebNSURLRequestExtras.m
380     mac/Misc/WebNSViewExtras.m
381     mac/Misc/WebNSWindowExtras.m
382
383     mac/Panels/WebAuthenticationPanel.m
384     mac/Panels/WebPanelAuthenticationHandler.m
385
386     mac/Plugins/WebPluginRequest.m
387     mac/Plugins/WebPluginsPrivate.m
388
389     mac/Plugins/Hosted/WebTextInputWindowController.m
390
391     mac/WebCoreSupport/WebJavaScriptTextInputPanel.m
392
393     mac/WebView/WebFormDelegate.m
394 )
395
396 foreach (_file ${WebKitLegacy_SOURCES})
397     list(FIND C99_FILES ${_file} _c99_index)
398     if (${_c99_index} EQUAL -1)
399         set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS "-ObjC++ -std=c++17")
400     else ()
401         set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS -std=c99)
402     endif ()
403 endforeach ()
404
405 file(COPY
406     mac/Plugins/Hosted/WebKitPluginAgent.defs
407     mac/Plugins/Hosted/WebKitPluginAgentReply.defs
408     mac/Plugins/Hosted/WebKitPluginClient.defs
409     mac/Plugins/Hosted/WebKitPluginHost.defs
410     mac/Plugins/Hosted/WebKitPluginHostTypes.defs
411     mac/Plugins/Hosted/WebKitPluginHostTypes.h
412 DESTINATION ${DERIVED_SOURCES_WEBKITLEGACY_DIR})
413
414 add_custom_command(
415     OUTPUT
416         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentReplyServer.c
417         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentReplyUser.c
418         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentServer.c
419         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentUser.c
420         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginHostServer.c
421         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginHostUser.c
422     DEPENDS mac/Plugins/Hosted/WebKitPluginAgent.defs mac/Plugins/Hosted/WebKitPluginHost.defs
423     WORKING_DIRECTORY ${DERIVED_SOURCES_WEBKITLEGACY_DIR}
424     COMMAND mig -I.. WebKitPluginAgent.defs WebKitPluginAgentReply.defs WebKitPluginHost.defs
425     VERBATIM)
426 add_custom_command(
427     OUTPUT
428         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginClientServer.c
429         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginClientUser.c
430     DEPENDS mac/Plugins/Hosted/WebKitPluginClient.defs
431     WORKING_DIRECTORY ${DERIVED_SOURCES_WEBKITLEGACY_DIR}
432     COMMAND mig -I.. -sheader WebKitPluginClientServer.h WebKitPluginClient.defs
433     VERBATIM)
434 list(APPEND WebKitLegacy_SOURCES
435     ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentUser.c
436     ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginClientServer.c
437     ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginHostUser.c
438 )
439
440 WEBKIT_CREATE_FORWARDING_HEADERS(WebKitLegacy DIRECTORIES ${WebKitLegacy_FORWARDING_HEADERS_DIRECTORIES} FILES ${WebKitLegacy_FORWARDING_HEADERS_FILES})
441
442 # FIXME: Forwarding headers should be copies of actual headers.
443 file(GLOB ObjCHeaders ${WEBCORE_DIR}/plugins/*.h)
444 list(APPEND ObjCHeaders
445     WebKitAvailability.h
446     WebScriptObject.h
447 )
448 foreach (_file ${ObjCHeaders})
449     get_filename_component(_name ${_file} NAME)
450     if (NOT EXISTS ${FORWARDING_HEADERS_DIR}/WebKitLegacy/${_name})
451         file(WRITE ${FORWARDING_HEADERS_DIR}/WebKitLegacy/${_name} "#import <WebCore/${_name}>")
452     endif ()
453 endforeach ()
454
455 set(WebKitLegacy_OUTPUT_NAME WebKitLegacy)
456
457 set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-compatibility_version 1 -current_version ${WEBKIT_MAC_VERSION}")