PolymorphicAccess should try to generate a stub only once
[WebKit.git] / Source / WebKit / PlatformMac.cmake
1 find_library(QUARTZ_LIBRARY Quartz)
2 add_definitions(-iframework ${QUARTZ_LIBRARY}/Frameworks)
3 link_directories(../../WebKitLibraries)
4
5 list(APPEND WebKit_INCLUDE_DIRECTORIES
6     "${DERIVED_SOURCES_DIR}"
7     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
8     "${DERIVED_SOURCES_WEBCORE_DIR}"
9     "${DERIVED_SOURCES_WEBKITLEGACY_DIR}"
10     "${JAVASCRIPTCORE_DIR}"
11     "${JAVASCRIPTCORE_DIR}/dfg"
12     "${WEBCORE_DIR}/accessibility/mac"
13     "${WEBCORE_DIR}/bindings/objc"
14     "${WEBCORE_DIR}/bridge"
15     "${WEBCORE_DIR}/bridge/jsc"
16     "${WEBCORE_DIR}/bridge/objc"
17     "${WEBCORE_DIR}/ForwardingHeaders/inspector"
18     "${WEBCORE_DIR}/html/track"
19     "${WEBCORE_DIR}/loader/archive/cf"
20     "${WEBCORE_DIR}/loader/cf"
21     "${WEBCORE_DIR}/loader/mac"
22     "${WEBCORE_DIR}/page/cocoa"
23     "${WEBCORE_DIR}/page/mac"
24     "${WEBCORE_DIR}/platform/cf"
25     "${WEBCORE_DIR}/platform/cocoa"
26     "${WEBCORE_DIR}/platform/graphics/avfoundation"
27     "${WEBCORE_DIR}/platform/graphics/avfoundation/cf"
28     "${WEBCORE_DIR}/platform/graphics/avfoundation/objc"
29     "${WEBCORE_DIR}/platform/graphics/ca"
30     "${WEBCORE_DIR}/platform/graphics/ca/mac"
31     "${WEBCORE_DIR}/platform/graphics/cocoa"
32     "${WEBCORE_DIR}/platform/graphics/cg"
33     "${WEBCORE_DIR}/platform/graphics/opentype"
34     "${WEBCORE_DIR}/platform/graphics/mac"
35     "${WEBCORE_DIR}/platform/mac"
36     "${WEBCORE_DIR}/platform/network/cocoa"
37     "${WEBCORE_DIR}/platform/network/cf"
38     "${WEBCORE_DIR}/platform/network/mac"
39     "${WEBCORE_DIR}/platform/text/cf"
40     "${WEBCORE_DIR}/platform/text/mac"
41     "${WEBCORE_DIR}/plugins/mac"
42     "${WEBCORE_DIR}/rendering/shapes"
43     "${WTF_DIR}"
44     ../../WebKitLibraries
45 )
46
47 list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
48     mac
49     mac/Carbon
50     mac/DefaultDelegates
51     mac/DOM
52     mac/History
53     mac/icu
54     mac/Misc
55     mac/Panels
56     mac/Plugins
57     mac/Plugins/Hosted
58     mac/Storage
59     mac/WebCoreSupport
60     mac/WebInspector
61     mac/WebView
62 )
63
64 list(APPEND WebKit_SOURCES
65     cf/WebCoreSupport/WebInspectorClientCF.cpp
66
67     mac/Carbon/CarbonUtils.m
68     mac/Carbon/CarbonWindowAdapter.mm
69     mac/Carbon/CarbonWindowContentView.m
70     mac/Carbon/CarbonWindowFrame.m
71     mac/Carbon/HIViewAdapter.m
72     mac/Carbon/HIWebView.mm
73
74     mac/DefaultDelegates/WebDefaultContextMenuDelegate.mm
75     mac/DefaultDelegates/WebDefaultEditingDelegate.m
76     mac/DefaultDelegates/WebDefaultPolicyDelegate.m
77     mac/DefaultDelegates/WebDefaultUIDelegate.m
78
79     mac/History/BinaryPropertyList.cpp
80     mac/History/HistoryPropertyList.mm
81     mac/History/WebBackForwardList.mm
82     mac/History/WebHistory.mm
83     mac/History/WebHistoryItem.mm
84     mac/History/WebURLsWithTitles.m
85
86     mac/Misc/OldWebAssertions.c
87     mac/Misc/WebCache.mm
88     mac/Misc/WebCoreStatistics.mm
89     mac/Misc/WebDownload.mm
90     mac/Misc/WebElementDictionary.mm
91     mac/Misc/WebIconDatabase.mm
92     mac/Misc/WebKitErrors.m
93     mac/Misc/WebKitLogging.m
94     mac/Misc/WebKitNSStringExtras.mm
95     mac/Misc/WebKitStatistics.m
96     mac/Misc/WebKitVersionChecks.m
97     mac/Misc/WebLocalizableStrings.mm
98     mac/Misc/WebLocalizableStringsInternal.mm
99     mac/Misc/WebNSControlExtras.m
100     mac/Misc/WebNSDataExtras.m
101     mac/Misc/WebNSDictionaryExtras.m
102     mac/Misc/WebNSEventExtras.m
103     mac/Misc/WebNSFileManagerExtras.mm
104     mac/Misc/WebNSImageExtras.m
105     mac/Misc/WebNSObjectExtras.mm
106     mac/Misc/WebNSPasteboardExtras.mm
107     mac/Misc/WebNSPrintOperationExtras.m
108     mac/Misc/WebNSURLExtras.mm
109     mac/Misc/WebNSURLRequestExtras.m
110     mac/Misc/WebNSUserDefaultsExtras.mm
111     mac/Misc/WebNSViewExtras.m
112     mac/Misc/WebNSWindowExtras.m
113     mac/Misc/WebSharingServicePickerController.mm
114     mac/Misc/WebStringTruncator.mm
115     mac/Misc/WebUserContentURLPattern.mm
116
117     mac/Panels/WebAuthenticationPanel.m
118     mac/Panels/WebPanelAuthenticationHandler.m
119
120     mac/Plugins/WebBaseNetscapePluginView.mm
121     mac/Plugins/WebBasePluginPackage.mm
122     mac/Plugins/WebNetscapeContainerCheckContextInfo.mm
123     mac/Plugins/WebNetscapeContainerCheckPrivate.mm
124     mac/Plugins/WebNetscapePluginEventHandler.mm
125     mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm
126     mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm
127     mac/Plugins/WebNetscapePluginPackage.mm
128     mac/Plugins/WebNetscapePluginStream.mm
129     mac/Plugins/WebNetscapePluginView.mm
130     mac/Plugins/WebPluginContainerCheck.mm
131     mac/Plugins/WebPluginController.mm
132     mac/Plugins/WebPluginDatabase.mm
133     mac/Plugins/WebPluginPackage.mm
134     mac/Plugins/WebPluginRequest.m
135     mac/Plugins/npapi.mm
136
137     mac/Plugins/Hosted/HostedNetscapePluginStream.mm
138     mac/Plugins/Hosted/NetscapePluginHostManager.mm
139     mac/Plugins/Hosted/NetscapePluginHostProxy.mm
140     mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
141     mac/Plugins/Hosted/ProxyInstance.mm
142     mac/Plugins/Hosted/ProxyRuntimeObject.mm
143     mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
144     mac/Plugins/Hosted/WebKitPluginAgent.defs
145     mac/Plugins/Hosted/WebKitPluginAgentReply.defs
146     mac/Plugins/Hosted/WebKitPluginClient.defs
147     mac/Plugins/Hosted/WebKitPluginHost.defs
148     mac/Plugins/Hosted/WebKitPluginHostTypes.defs
149     mac/Plugins/Hosted/WebTextInputWindowController.m
150
151     mac/Storage/WebDatabaseManager.mm
152     mac/Storage/WebDatabaseManagerClient.mm
153     mac/Storage/WebDatabaseProvider.mm
154     mac/Storage/WebDatabaseQuotaManager.mm
155     mac/Storage/WebStorageManager.mm
156     mac/Storage/WebStorageTrackerClient.mm
157
158     mac/WebCoreSupport/CorrectionPanel.mm
159     mac/WebCoreSupport/PopupMenuMac.mm
160     mac/WebCoreSupport/SearchPopupMenuMac.mm
161     mac/WebCoreSupport/WebAlternativeTextClient.mm
162     mac/WebCoreSupport/WebApplicationCache.mm
163     mac/WebCoreSupport/WebApplicationCacheQuotaManager.mm
164     mac/WebCoreSupport/WebChromeClient.mm
165     mac/WebCoreSupport/WebContextMenuClient.mm
166     mac/WebCoreSupport/WebDeviceOrientationClient.mm
167     mac/WebCoreSupport/WebDragClient.mm
168     mac/WebCoreSupport/WebEditorClient.mm
169     mac/WebCoreSupport/WebFrameLoaderClient.mm
170     mac/WebCoreSupport/WebFrameNetworkingContext.mm
171     mac/WebCoreSupport/WebGeolocationClient.mm
172     mac/WebCoreSupport/WebIconDatabaseClient.mm
173     mac/WebCoreSupport/WebInspectorClient.mm
174     mac/WebCoreSupport/WebJavaScriptTextInputPanel.m
175     mac/WebCoreSupport/WebKeyGenerator.mm
176     mac/WebCoreSupport/WebKitFullScreenListener.mm
177     mac/WebCoreSupport/WebNotificationClient.mm
178     mac/WebCoreSupport/WebOpenPanelResultListener.mm
179     mac/WebCoreSupport/WebPlatformStrategies.mm
180     mac/WebCoreSupport/WebProgressTrackerClient.mm
181     mac/WebCoreSupport/WebSecurityOrigin.mm
182     mac/WebCoreSupport/WebSelectionServiceController.mm
183     mac/WebCoreSupport/WebSystemInterface.mm
184     mac/WebCoreSupport/WebUserMediaClient.mm
185     mac/WebCoreSupport/WebVisitedLinkStore.mm
186
187     mac/WebInspector/WebInspector.mm
188     mac/WebInspector/WebInspectorFrontend.mm
189     mac/WebInspector/WebNodeHighlight.mm
190     mac/WebInspector/WebNodeHighlightView.mm
191     mac/WebInspector/WebNodeHighlighter.mm
192
193     mac/WebView/WebArchive.mm
194     mac/WebView/WebClipView.mm
195     mac/WebView/WebDashboardRegion.mm
196     mac/WebView/WebDataSource.mm
197     mac/WebView/WebDelegateImplementationCaching.mm
198     mac/WebView/WebDeviceOrientation.mm
199     mac/WebView/WebDeviceOrientationProviderMock.mm
200     mac/WebView/WebDocumentLoaderMac.mm
201     mac/WebView/WebDynamicScrollBarsView.mm
202     mac/WebView/WebFormDelegate.m
203     mac/WebView/WebFrame.mm
204     mac/WebView/WebFrameView.mm
205     mac/WebView/WebFullScreenController.mm
206     mac/WebView/WebGeolocationPosition.mm
207     mac/WebView/WebHTMLRepresentation.mm
208     mac/WebView/WebHTMLView.mm
209     mac/WebView/WebImmediateActionController.mm
210     mac/WebView/WebIndicateLayer.mm
211     mac/WebView/WebJSPDFDoc.mm
212     mac/WebView/WebNavigationData.mm
213     mac/WebView/WebNotification.mm
214     mac/WebView/WebPDFDocumentExtras.mm
215     mac/WebView/WebPDFRepresentation.mm
216     mac/WebView/WebPDFView.mm
217     mac/WebView/WebPolicyDelegate.mm
218     mac/WebView/WebPreferences.mm
219     mac/WebView/WebResource.mm
220     mac/WebView/WebScriptDebugDelegate.mm
221     mac/WebView/WebScriptDebugger.mm
222     mac/WebView/WebScriptWorld.mm
223     mac/WebView/WebTextCompletionController.mm
224     mac/WebView/WebTextIterator.mm
225     mac/WebView/WebView.mm
226     mac/WebView/WebViewData.mm
227 )
228
229 set(WebKit_LIBRARY_TYPE SHARED)
230
231 set(WebKitLegacy_FORWARDING_HEADERS_DIRECTORIES
232     mac/DOM
233     mac/DefaultDelegates
234     mac/History
235     mac/Misc
236     mac/Panels
237     mac/Plugins
238     mac/WebCoreSupport
239     mac/WebInspector
240     mac/WebView
241 )
242
243 set(WebKitLegacy_FORWARDING_HEADERS_FILES
244     mac/DOM/WebDOMOperations.h
245
246     mac/History/WebHistory.h
247     mac/History/WebHistoryItem.h
248
249     mac/Misc/WebNSURLExtras.h
250
251     mac/Panels/WebPanelAuthenticationHandler.h
252
253     mac/Plugins/WebBasePluginPackage.h
254
255     mac/WebCoreSupport/WebKeyGenerator.h
256
257     mac/WebInspector/WebInspector.h
258
259     mac/WebView/WebFrame.h
260     mac/WebView/WebView.h
261
262     ${DERIVED_SOURCES_WEBCORE_DIR}/DOMRange.h
263
264     ${WEBCORE_DIR}/bindings/objc/DOMCore.h
265     ${WEBCORE_DIR}/bindings/objc/DOMExtensions.h
266
267     ${WEBCORE_DIR}/plugins/npfunctions.h
268 )
269
270 add_definitions("-include WebKitPrefix.h")
271
272 set(C99_FILES
273     ${WEBKIT_DIR}/mac/Carbon/CarbonUtils.m
274     ${WEBKIT_DIR}/mac/Carbon/CarbonWindowContentView.m
275     ${WEBKIT_DIR}/mac/Carbon/CarbonWindowFrame.m
276     ${WEBKIT_DIR}/mac/Carbon/HIViewAdapter.m
277
278     mac/DefaultDelegates/WebDefaultEditingDelegate.m
279     mac/DefaultDelegates/WebDefaultPolicyDelegate.m
280     mac/DefaultDelegates/WebDefaultUIDelegate.m
281
282     mac/Misc/OldWebAssertions.c
283
284     mac/Misc/WebKitErrors.m
285     mac/Misc/WebKitLogging.m
286     mac/Misc/WebKitStatistics.m
287     mac/Misc/WebKitSystemBits.m
288     mac/Misc/WebKitVersionChecks.m
289     mac/Misc/WebNSArrayExtras.m
290     mac/Misc/WebNSControlExtras.m
291     mac/Misc/WebNSDataExtras.m
292     mac/Misc/WebNSDictionaryExtras.m
293     mac/Misc/WebNSEventExtras.m
294     mac/Misc/WebNSImageExtras.m
295     mac/Misc/WebNSPrintOperationExtras.m
296     mac/Misc/WebNSURLRequestExtras.m
297     mac/Misc/WebNSViewExtras.m
298     mac/Misc/WebNSWindowExtras.m
299
300     mac/Panels/WebAuthenticationPanel.m
301     mac/Panels/WebPanelAuthenticationHandler.m
302
303     mac/Plugins/WebPluginRequest.m
304     mac/Plugins/WebPluginsPrivate.m
305
306     mac/Plugins/Hosted/WebTextInputWindowController.m
307
308     mac/WebCoreSupport/WebJavaScriptTextInputPanel.m
309
310     mac/WebView/WebFormDelegate.m
311 )
312
313 foreach (_file ${WebKit_SOURCES})
314     list(FIND C99_FILES ${_file} _c99_index)
315     if (${_c99_index} EQUAL -1)
316         set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS "-ObjC++ -std=c++11")
317     else ()
318         set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS -std=c99)
319     endif ()
320 endforeach ()
321
322 file(COPY
323     mac/Plugins/Hosted/WebKitPluginAgent.defs
324     mac/Plugins/Hosted/WebKitPluginAgentReply.defs
325     mac/Plugins/Hosted/WebKitPluginClient.defs
326     mac/Plugins/Hosted/WebKitPluginHost.defs
327     mac/Plugins/Hosted/WebKitPluginHostTypes.defs
328     mac/Plugins/Hosted/WebKitPluginHostTypes.h
329 DESTINATION ${DERIVED_SOURCES_WEBKITLEGACY_DIR})
330
331 add_custom_command(
332     OUTPUT
333         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentReplyServer.c
334         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentReplyUser.c
335         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentServer.c
336         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentUser.c
337         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginHostServer.c
338         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginHostUser.c
339     MAIN_DEPENDENCY mac/Plugins/Hosted/WebKitPluginAgent.defs
340     WORKING_DIRECTORY ${DERIVED_SOURCES_WEBKITLEGACY_DIR}
341     COMMAND mig -I.. WebKitPluginAgent.defs WebKitPluginAgentReply.defs WebKitPluginHost.defs
342     VERBATIM)
343 add_custom_command(
344     OUTPUT
345         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginClientServer.c
346         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginClientUser.c
347     MAIN_DEPENDENCY mac/Plugins/Hosted/WebKitPluginAgent.defs
348     WORKING_DIRECTORY ${DERIVED_SOURCES_WEBKITLEGACY_DIR}
349     COMMAND mig -I.. -sheader WebKitPluginClientServer.h WebKitPluginClient.defs
350     VERBATIM)
351 list(APPEND WebKit_SOURCES
352     ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentUser.c
353     ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginClientServer.c
354     ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginHostUser.c
355 )
356
357 WEBKIT_CREATE_FORWARDING_HEADERS(WebKitLegacy DIRECTORIES ${WebKitLegacy_FORWARDING_HEADERS_DIRECTORIES} FILES ${WebKitLegacy_FORWARDING_HEADERS_FILES})
358 WEBKIT_CREATE_FORWARDING_HEADERS(WebKit DIRECTORIES ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy)
359
360 # FIXME: Forwarding headers should be copies of actual headers.
361 file(GLOB ObjCHeaders ${WEBCORE_DIR}/bindings/objc/*.h)
362 foreach (_file ${ObjCHeaders})
363     get_filename_component(_name ${_file} NAME)
364     if (NOT EXISTS ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy/${_name})
365         file(WRITE ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy/${_name} "#import <WebCore/${_name}>")
366     endif ()
367 endforeach ()
368 file(GLOB ObjCHeaders ${WEBCORE_DIR}/plugins/*.h)
369 foreach (_file ${ObjCHeaders})
370     get_filename_component(_name ${_file} NAME)
371     if (NOT EXISTS ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy/${_name})
372         file(WRITE ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy/${_name} "#import <WebCore/${_name}>")
373     endif ()
374 endforeach ()
375
376 set(WebKit_OUTPUT_NAME WebKitLegacy)
377
378 set(WebKitLegacy_WebCore_FORWARDING_HEADERS
379     DOMElement.h
380     DOMHTMLFormElement.h
381     DOMHTMLInputElement.h
382     DOMWheelEvent.h
383 )
384
385 # FIXME: These shouldn't be necessary, but it doesn't compile without them.
386 foreach (_file ${WebKitLegacy_WebCore_FORWARDING_HEADERS})
387     if (NOT EXISTS ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/${_file})
388         file(WRITE ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/${_file} "#import <WebCore/${_file}>")
389     endif ()
390 endforeach ()
391
392 set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-compatibility_version 1 -current_version ${WEBKIT_MAC_VERSION}")