e8d43330842c42ade3fcf0cf0e01a4086355508a
[WebKit-https.git] / Source / WebCore / UseJSC.cmake
1 list(APPEND WebCore_INCLUDE_DIRECTORIES
2     "${WEBCORE_DIR}/bindings/js"
3     "${WEBCORE_DIR}/bridge/jsc"
4 )
5
6 list(APPEND WebCoreTestSupport_INCLUDE_DIRECTORIES
7     "${WEBCORE_DIR}/testing/js"
8 )
9
10 list(APPEND WebCore_IDL_INCLUDES
11     bindings/js
12 )
13
14 if (PORT MATCHES "BlackBerry")
15     list(APPEND WebCore_IDL_INCLUDES
16         testing/js
17     )
18     list(APPEND WebCore_IDL_FILES
19         testing/Internals.idl
20         testing/InternalSettings.idl
21     )
22 endif ()
23
24 list(APPEND WebCore_SOURCES
25     bindings/js/ArrayValue.cpp
26     bindings/js/BindingState.cpp
27     bindings/js/CallbackFunction.cpp
28     bindings/js/DOMObjectHashTableMap.cpp
29     bindings/js/DOMWrapperWorld.cpp
30     bindings/js/Dictionary.cpp
31     bindings/js/GCController.cpp
32     bindings/js/JSArrayBufferCustom.cpp
33     bindings/js/JSAudioBufferCustom.cpp
34     bindings/js/JSAttrCustom.cpp
35     bindings/js/JSBlobCustom.cpp
36     bindings/js/JSCDATASectionCustom.cpp
37     bindings/js/JSDataViewCustom.cpp
38     bindings/js/JSCSSFontFaceRuleCustom.cpp
39     bindings/js/JSCSSImportRuleCustom.cpp
40     bindings/js/JSCSSMediaRuleCustom.cpp
41     bindings/js/JSCSSPageRuleCustom.cpp
42     bindings/js/JSCSSRuleCustom.cpp
43     bindings/js/JSCSSRuleListCustom.cpp
44     bindings/js/JSCSSStyleDeclarationCustom.cpp
45     bindings/js/JSCSSStyleRuleCustom.cpp
46     bindings/js/JSCSSValueCustom.cpp
47     bindings/js/JSCallbackData.cpp
48     bindings/js/JSCanvasRenderingContext2DCustom.cpp
49     bindings/js/JSCanvasRenderingContextCustom.cpp
50     bindings/js/JSClipboardCustom.cpp
51     bindings/js/JSConsoleCustom.cpp
52     bindings/js/JSCryptoCustom.cpp
53     bindings/js/JSCustomXPathNSResolver.cpp
54     bindings/js/JSDictionary.cpp
55     bindings/js/JSDOMBinding.cpp
56     bindings/js/JSDOMFormDataCustom.cpp
57     bindings/js/JSDOMGlobalObject.cpp
58     bindings/js/JSDOMImplementationCustom.cpp
59     bindings/js/JSDOMMimeTypeArrayCustom.cpp
60     bindings/js/JSDOMPluginArrayCustom.cpp
61     bindings/js/JSDOMPluginCustom.cpp
62     bindings/js/JSDOMStringListCustom.cpp
63     bindings/js/JSDOMStringMapCustom.cpp
64     bindings/js/JSDOMTokenListCustom.cpp
65     bindings/js/JSDOMWindowBase.cpp
66     bindings/js/JSDOMWindowCustom.cpp
67     bindings/js/JSDOMWindowShell.cpp
68     bindings/js/JSDOMWindowWebAudioCustom.cpp
69     bindings/js/JSDOMWindowWebSocketCustom.cpp
70     bindings/js/JSDOMWrapper.cpp
71     bindings/js/JSDeviceMotionEventCustom.cpp
72     bindings/js/JSDeviceOrientationEventCustom.cpp
73     bindings/js/JSDocumentCustom.cpp
74     bindings/js/JSElementCustom.cpp
75     bindings/js/JSErrorHandler.cpp
76     bindings/js/JSEventCustom.cpp
77     bindings/js/JSEventListener.cpp
78     bindings/js/JSEventTargetCustom.cpp
79     bindings/js/JSExceptionBase.cpp
80     bindings/js/JSGeolocationCustom.cpp
81     bindings/js/JSHTMLAllCollectionCustom.cpp
82     bindings/js/JSHTMLAppletElementCustom.cpp
83     bindings/js/JSHTMLCanvasElementCustom.cpp
84     bindings/js/JSHTMLCollectionCustom.cpp
85     bindings/js/JSHTMLDocumentCustom.cpp
86     bindings/js/JSHTMLElementCustom.cpp
87     bindings/js/JSHTMLEmbedElementCustom.cpp
88     bindings/js/JSHTMLFormControlsCollectionCustom.cpp
89     bindings/js/JSHTMLFormElementCustom.cpp
90     bindings/js/JSHTMLFrameElementCustom.cpp
91     bindings/js/JSHTMLFrameSetElementCustom.cpp
92     bindings/js/JSHTMLInputElementCustom.cpp
93     bindings/js/JSHTMLLinkElementCustom.cpp
94     bindings/js/JSHTMLMediaElementCustom.cpp
95     bindings/js/JSHTMLObjectElementCustom.cpp
96     bindings/js/JSHTMLOptionsCollectionCustom.cpp
97     bindings/js/JSHTMLSelectElementCustom.cpp
98     bindings/js/JSHTMLStyleElementCustom.cpp
99     bindings/js/JSHTMLTemplateElementCustom.cpp
100     bindings/js/JSHistoryCustom.cpp
101     bindings/js/JSImageConstructor.cpp
102     bindings/js/JSImageDataCustom.cpp
103     bindings/js/JSInjectedScriptHostCustom.cpp
104     bindings/js/JSInjectedScriptManager.cpp
105     bindings/js/JSInspectorFrontendHostCustom.cpp
106     bindings/js/JSJavaScriptCallFrameCustom.cpp
107     bindings/js/JSLazyEventListener.cpp
108     bindings/js/JSLocationCustom.cpp
109     bindings/js/JSMainThreadExecState.cpp
110     bindings/js/JSMediaListCustom.cpp
111     bindings/js/JSMemoryInfoCustom.cpp
112     bindings/js/JSMessageChannelCustom.cpp
113     bindings/js/JSMessageEventCustom.cpp
114     bindings/js/JSMessagePortCustom.cpp
115     bindings/js/JSMicroDataItemValueCustom.cpp
116     bindings/js/JSMutationCallback.cpp
117     bindings/js/JSMutationObserverCustom.cpp
118     bindings/js/JSNamedNodeMapCustom.cpp
119     bindings/js/JSNodeCustom.cpp
120     bindings/js/JSNodeFilterCondition.cpp
121     bindings/js/JSNodeFilterCustom.cpp
122     bindings/js/JSNodeIteratorCustom.cpp
123     bindings/js/JSNodeListCustom.cpp
124     bindings/js/JSPluginElementFunctions.cpp
125     bindings/js/JSPopStateEventCustom.cpp
126     bindings/js/JSProcessingInstructionCustom.cpp
127     bindings/js/JSStorageCustom.cpp
128     bindings/js/JSStyleSheetCustom.cpp
129     bindings/js/JSStyleSheetListCustom.cpp
130     bindings/js/JSTextCustom.cpp
131     bindings/js/JSTouchCustom.cpp
132     bindings/js/JSTouchListCustom.cpp
133     bindings/js/JSTreeWalkerCustom.cpp
134     bindings/js/JSWebKitCSSKeyframeRuleCustom.cpp
135     bindings/js/JSWebKitCSSKeyframesRuleCustom.cpp
136     bindings/js/JSWebKitPointCustom.cpp
137     bindings/js/JSXMLHttpRequestCustom.cpp
138     bindings/js/JSXMLHttpRequestUploadCustom.cpp
139     bindings/js/JSXPathResultCustom.cpp
140     bindings/js/JSXSLTProcessorCustom.cpp
141     bindings/js/JavaScriptCallFrame.cpp
142     bindings/js/PageScriptDebugServer.cpp
143     bindings/js/ScheduledAction.cpp
144     bindings/js/ScriptCachedFrameData.cpp
145     bindings/js/ScriptCallStackFactory.cpp
146     bindings/js/ScriptController.cpp
147     bindings/js/ScriptDebugServer.cpp
148     bindings/js/ScriptEventListener.cpp
149     bindings/js/ScriptFunctionCall.cpp
150     bindings/js/ScriptGCEvent.cpp
151     bindings/js/ScriptObject.cpp
152     bindings/js/ScriptProfile.cpp
153     bindings/js/ScriptProfiler.cpp
154     bindings/js/ScriptState.cpp
155     bindings/js/ScriptValue.cpp
156     bindings/js/SerializedScriptValue.cpp
157
158     bridge/IdentifierRep.cpp
159     bridge/NP_jsobject.cpp
160     bridge/npruntime.cpp
161     bridge/runtime_array.cpp
162     bridge/runtime_method.cpp
163     bridge/runtime_object.cpp
164     bridge/runtime_root.cpp
165
166     bridge/c/CRuntimeObject.cpp
167     bridge/c/c_class.cpp
168     bridge/c/c_instance.cpp
169     bridge/c/c_runtime.cpp
170     bridge/c/c_utility.cpp
171
172     bridge/jsc/BridgeJSC.cpp
173 )
174
175 list(APPEND WebCoreTestSupport_SOURCES
176     testing/js/WebCoreTestSupport.cpp
177 )
178
179 if (ENABLE_BLOB)
180     list(APPEND WebCore_SOURCES
181         bindings/js/JSFileReaderCustom.cpp
182     )
183 endif ()
184
185 if (ENABLE_REQUEST_ANIMATION_FRAME)
186     list(APPEND WebCore_SOURCES
187         bindings/js/JSRequestAnimationFrameCallbackCustom.cpp
188     )
189 endif ()
190
191 if (ENABLE_SQL_DATABASE)
192     list(APPEND WebCore_SOURCES
193         bindings/js/JSCustomSQLStatementErrorCallback.cpp
194         bindings/js/JSSQLResultSetRowListCustom.cpp
195         bindings/js/JSSQLTransactionCustom.cpp
196         bindings/js/JSSQLTransactionSyncCustom.cpp
197     )
198 endif ()
199
200 if (ENABLE_INDEXED_DATABASE)
201     list(APPEND WebCore_SOURCES
202         bindings/js/IDBBindingUtilities.cpp
203         bindings/js/JSIDBAnyCustom.cpp
204         bindings/js/JSIDBDatabaseCustom.cpp
205         bindings/js/JSIDBObjectStoreCustom.cpp
206     )
207 endif ()
208
209 if (ENABLE_WORKERS)
210     list(APPEND WebCore_SOURCES
211         bindings/js/JSDedicatedWorkerContextCustom.cpp
212         bindings/js/JSWorkerContextBase.cpp
213         bindings/js/JSWorkerContextCustom.cpp
214         bindings/js/JSWorkerCustom.cpp
215         bindings/js/WorkerScriptController.cpp
216         bindings/js/WorkerScriptDebugServer.cpp
217     )
218 endif ()
219
220 if (ENABLE_VIDEO_TRACK)
221     list(APPEND WebCore_SOURCES
222         bindings/js/JSAudioTrackCustom.cpp
223         bindings/js/JSAudioTrackListCustom.cpp
224         bindings/js/JSTextTrackCueCustom.cpp
225         bindings/js/JSTextTrackCustom.cpp
226         bindings/js/JSTextTrackListCustom.cpp
227         bindings/js/JSTrackCustom.cpp
228         bindings/js/JSTrackEventCustom.cpp
229         bindings/js/JSVideoTrackCustom.cpp
230         bindings/js/JSVideoTrackListCustom.cpp
231     )
232 endif ()
233
234 if (ENABLE_SHARED_WORKERS)
235     list(APPEND WebCore_SOURCES
236         bindings/js/JSSharedWorkerCustom.cpp
237     )
238 endif ()
239
240 if (ENABLE_FILE_SYSTEM)
241     list(APPEND WebCore_SOURCES
242         bindings/js/JSEntryCustom.cpp
243         bindings/js/JSEntrySyncCustom.cpp
244     )
245 endif ()
246
247 if (ENABLE_SVG)
248     list(APPEND WebCore_SOURCES
249         bindings/js/JSSVGElementInstanceCustom.cpp
250         bindings/js/JSSVGLengthCustom.cpp
251         bindings/js/JSSVGPathSegCustom.cpp
252     )
253 endif ()
254
255 if (ENABLE_WEBGL)
256     list(APPEND WebCore_SOURCES
257         bindings/js/JSWebGLRenderingContextCustom.cpp
258     )
259 endif ()
260
261 if (ENABLE_WEB_AUDIO)
262     list(APPEND WebCore_SOURCES
263         bindings/js/JSAudioBufferSourceNodeCustom.cpp
264         bindings/js/JSAudioContextCustom.cpp
265         bindings/js/JSBiquadFilterNodeCustom.cpp
266         bindings/js/JSOscillatorNodeCustom.cpp
267         bindings/js/JSPannerNodeCustom.cpp
268     )
269 endif ()
270
271 if (ENABLE_MEDIA_STREAM)
272     list(APPEND WebCore_SOURCES
273         bindings/js/JSRTCStatsResponseCustom.cpp
274     )
275 endif ()
276
277 list(APPEND SCRIPTS_BINDINGS
278     ${WEBCORE_DIR}/bindings/scripts/CodeGenerator.pm
279     ${WEBCORE_DIR}/bindings/scripts/CodeGeneratorJS.pm
280 )
281
282 set(IDL_INCLUDES "")
283 foreach (_include ${WebCore_IDL_INCLUDES})
284     list(APPEND IDL_INCLUDES --include=${WEBCORE_DIR}/${_include})
285 endforeach ()
286
287 foreach (_include ${WebCoreTestSupport_IDL_INCLUDES})
288     list(APPEND IDL_INCLUDES --include=${WEBCORE_DIR}/${_include})
289 endforeach ()
290
291 set(FEATURE_DEFINES_JAVASCRIPT "LANGUAGE_JAVASCRIPT=1 ${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}")
292
293 # Create JavaScript C++ code given an IDL input
294 foreach (_idl ${WebCore_IDL_FILES})
295     set(IDL_FILES_LIST "${IDL_FILES_LIST}${WEBCORE_DIR}/${_idl}\n")
296 endforeach ()
297
298 foreach (_idl ${WebCoreTestSupport_IDL_FILES})
299     set(IDL_FILES_LIST "${IDL_FILES_LIST}${WEBCORE_DIR}/${_idl}\n")
300 endforeach ()
301
302 set(IDL_FILES_LIST "${IDL_FILES_LIST}${DERIVED_SOURCES_WEBCORE_DIR}/InternalSettingsGenerated.idl\n")
303 list(APPEND IDL_INCLUDES --include=${DERIVED_SOURCES_WEBCORE_DIR})
304 list(APPEND WebCoreTestSupport_IDL_FILES ${DERIVED_SOURCES_WEBCORE_DIR}/InternalSettingsGenerated.idl)
305
306 file(WRITE ${IDL_FILES_TMP} ${IDL_FILES_LIST})
307
308 add_custom_command(
309     OUTPUT ${SUPPLEMENTAL_DEPENDENCY_FILE}
310     DEPENDS ${WEBCORE_DIR}/bindings/scripts/preprocess-idls.pl ${SCRIPTS_PREPROCESS_IDLS} ${WebCore_IDL_FILES} ${WebCoreTestSupport_IDL_FILES}
311     COMMAND ${PERL_EXECUTABLE} -I${WEBCORE_DIR}/bindings/scripts ${WEBCORE_DIR}/bindings/scripts/preprocess-idls.pl --defines "${FEATURE_DEFINES_JAVASCRIPT}" --idlFilesList ${IDL_FILES_TMP} --supplementalDependencyFile ${SUPPLEMENTAL_DEPENDENCY_FILE}
312     VERBATIM)
313
314 GENERATE_BINDINGS(WebCore_SOURCES
315     "${WebCore_IDL_FILES}"
316     "${WEBCORE_DIR}"
317     "${IDL_INCLUDES}"
318     "${FEATURE_DEFINES_JAVASCRIPT}"
319     ${DERIVED_SOURCES_WEBCORE_DIR} JS JS
320     ${IDL_ATTRIBUTES_FILE}
321     ${SUPPLEMENTAL_DEPENDENCY_FILE})
322
323 GENERATE_BINDINGS(WebCoreTestSupport_SOURCES
324     "${WebCoreTestSupport_IDL_FILES}"
325     "${WEBCORE_DIR}"
326     "${IDL_INCLUDES}"
327     "${FEATURE_DEFINES_JAVASCRIPT}"
328     ${DERIVED_SOURCES_WEBCORE_DIR} JS JS
329     ${IDL_ATTRIBUTES_FILE}
330     ${SUPPLEMENTAL_DEPENDENCY_FILE})