Rename resolve-supplemental.pl to preprocess-idls.pl
[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 WebCore_IDL_INCLUDES
7     bindings/js
8 )
9
10 LIST(APPEND WebCore_SOURCES
11     bindings/js/CallbackFunction.cpp
12     bindings/js/DOMObjectHashTableMap.cpp
13     bindings/js/DOMWrapperWorld.cpp
14     bindings/js/GCController.cpp
15     bindings/js/JSArrayBufferCustom.cpp
16     bindings/js/JSAttrCustom.cpp
17     bindings/js/JSBlobCustom.cpp
18     bindings/js/JSCDATASectionCustom.cpp
19     bindings/js/JSDataViewCustom.cpp
20     bindings/js/JSCSSFontFaceRuleCustom.cpp
21     bindings/js/JSCSSImportRuleCustom.cpp
22     bindings/js/JSCSSMediaRuleCustom.cpp
23     bindings/js/JSCSSPageRuleCustom.cpp
24     bindings/js/JSCSSRuleCustom.cpp
25     bindings/js/JSCSSRuleListCustom.cpp
26     bindings/js/JSCSSStyleDeclarationCustom.cpp
27     bindings/js/JSCSSStyleRuleCustom.cpp
28     bindings/js/JSCSSValueCustom.cpp
29     bindings/js/JSCallbackData.cpp
30     bindings/js/JSCanvasRenderingContext2DCustom.cpp
31     bindings/js/JSCanvasRenderingContextCustom.cpp
32     bindings/js/JSClipboardCustom.cpp
33     bindings/js/JSConsoleCustom.cpp
34     bindings/js/JSCoordinatesCustom.cpp
35     bindings/js/JSCustomVoidCallback.cpp
36     bindings/js/JSCustomXPathNSResolver.cpp
37     bindings/js/JSDictionary.cpp
38     bindings/js/JSDOMBinding.cpp
39     bindings/js/JSDOMFormDataCustom.cpp
40     bindings/js/JSDOMGlobalObject.cpp
41     bindings/js/JSDOMImplementationCustom.cpp
42     bindings/js/JSDOMMimeTypeArrayCustom.cpp
43     bindings/js/JSDOMPluginArrayCustom.cpp
44     bindings/js/JSDOMPluginCustom.cpp
45     bindings/js/JSDOMStringMapCustom.cpp
46     bindings/js/JSDOMTokenListCustom.cpp
47     bindings/js/JSDOMWindowBase.cpp
48     bindings/js/JSDOMWindowCustom.cpp
49     bindings/js/JSDOMWindowShell.cpp
50     bindings/js/JSDOMWindowWebAudioCustom.cpp
51     bindings/js/JSDOMWindowWebSocketCustom.cpp
52     bindings/js/JSDOMWrapper.cpp
53     bindings/js/JSDeviceMotionEventCustom.cpp
54     bindings/js/JSDeviceOrientationEventCustom.cpp
55     bindings/js/JSDocumentCustom.cpp
56     bindings/js/JSElementCustom.cpp
57     bindings/js/JSErrorHandler.cpp
58     bindings/js/JSEventCustom.cpp
59     bindings/js/JSEventListener.cpp
60     bindings/js/JSEventTarget.cpp
61     bindings/js/JSExceptionBase.cpp
62     bindings/js/JSFloat32ArrayCustom.cpp
63     bindings/js/JSFloat64ArrayCustom.cpp
64     bindings/js/JSGeolocationCustom.cpp
65     bindings/js/JSHTMLAllCollectionCustom.cpp
66     bindings/js/JSHTMLAppletElementCustom.cpp
67     bindings/js/JSHTMLCanvasElementCustom.cpp
68     bindings/js/JSHTMLCollectionCustom.cpp
69     bindings/js/JSHTMLDocumentCustom.cpp
70     bindings/js/JSHTMLElementCustom.cpp
71     bindings/js/JSHTMLEmbedElementCustom.cpp
72     bindings/js/JSHTMLFormElementCustom.cpp
73     bindings/js/JSHTMLFrameElementCustom.cpp
74     bindings/js/JSHTMLFrameSetElementCustom.cpp
75     bindings/js/JSHTMLInputElementCustom.cpp
76     bindings/js/JSHTMLLinkElementCustom.cpp
77     bindings/js/JSHTMLMediaElementCustom.cpp
78     bindings/js/JSHTMLObjectElementCustom.cpp
79     bindings/js/JSHTMLOptionsCollectionCustom.cpp
80     bindings/js/JSHTMLOutputElementCustom.cpp
81     bindings/js/JSHTMLSelectElementCustom.cpp
82     bindings/js/JSHTMLStyleElementCustom.cpp
83     bindings/js/JSHistoryCustom.cpp
84     bindings/js/JSImageConstructor.cpp
85     bindings/js/JSImageDataCustom.cpp
86     bindings/js/JSInt16ArrayCustom.cpp
87     bindings/js/JSInt32ArrayCustom.cpp
88     bindings/js/JSInt8ArrayCustom.cpp
89     bindings/js/JSInjectedScriptHostCustom.cpp
90     bindings/js/JSInjectedScriptManager.cpp
91     bindings/js/JSInspectorFrontendHostCustom.cpp
92     bindings/js/JSJavaScriptCallFrameCustom.cpp
93     bindings/js/JSLazyEventListener.cpp
94     bindings/js/JSLocationCustom.cpp
95     bindings/js/JSMainThreadExecState.cpp
96     bindings/js/JSMediaListCustom.cpp
97     bindings/js/JSMemoryInfoCustom.cpp
98     bindings/js/JSMessageChannelCustom.cpp
99     bindings/js/JSMessageEventCustom.cpp
100     bindings/js/JSMessagePortCustom.cpp
101     bindings/js/JSMutationCallbackCustom.cpp
102     bindings/js/JSNamedNodeMapCustom.cpp
103     bindings/js/JSNodeCustom.cpp
104     bindings/js/JSNodeFilterCondition.cpp
105     bindings/js/JSNodeFilterCustom.cpp
106     bindings/js/JSNodeIteratorCustom.cpp
107     bindings/js/JSNodeListCustom.cpp
108     bindings/js/JSPluginElementFunctions.cpp
109     bindings/js/JSPopStateEventCustom.cpp
110     bindings/js/JSProcessingInstructionCustom.cpp
111     bindings/js/JSScriptProfileNodeCustom.cpp
112     bindings/js/JSStorageCustom.cpp
113     bindings/js/JSStyleSheetCustom.cpp
114     bindings/js/JSStyleSheetListCustom.cpp
115     bindings/js/JSTextCustom.cpp
116     bindings/js/JSTouchCustom.cpp
117     bindings/js/JSTouchListCustom.cpp
118     bindings/js/JSTreeWalkerCustom.cpp
119     bindings/js/JSUint16ArrayCustom.cpp 
120     bindings/js/JSUint32ArrayCustom.cpp
121     bindings/js/JSUint8ArrayCustom.cpp
122     bindings/js/JSUint8ClampedArrayCustom.cpp
123     bindings/js/JSWebKitAnimationCustom.cpp
124     bindings/js/JSWebKitAnimationListCustom.cpp
125     bindings/js/JSWebKitCSSKeyframeRuleCustom.cpp
126     bindings/js/JSWebKitCSSKeyframesRuleCustom.cpp
127     bindings/js/JSWebKitMutationObserverCustom.cpp
128     bindings/js/JSWebKitPointCustom.cpp
129     bindings/js/JSXMLHttpRequestCustom.cpp
130     bindings/js/JSXMLHttpRequestUploadCustom.cpp
131     bindings/js/JSXPathResultCustom.cpp
132     bindings/js/JSXSLTProcessorCustom.cpp
133     bindings/js/JavaScriptCallFrame.cpp
134     bindings/js/PageScriptDebugServer.cpp
135     bindings/js/ScheduledAction.cpp
136     bindings/js/ScriptCachedFrameData.cpp
137     bindings/js/ScriptCallStackFactory.cpp
138     bindings/js/ScriptController.cpp
139     bindings/js/ScriptDebugServer.cpp
140     bindings/js/ScriptEventListener.cpp
141     bindings/js/ScriptFunctionCall.cpp
142     bindings/js/ScriptGCEvent.cpp
143     bindings/js/ScriptObject.cpp
144     bindings/js/ScriptProfile.cpp
145     bindings/js/ScriptProfiler.cpp
146     bindings/js/ScriptState.cpp
147     bindings/js/ScriptValue.cpp
148     bindings/js/SerializedScriptValue.cpp
149
150     bridge/IdentifierRep.cpp
151     bridge/NP_jsobject.cpp
152     bridge/npruntime.cpp
153     bridge/runtime_array.cpp
154     bridge/runtime_method.cpp
155     bridge/runtime_object.cpp
156     bridge/runtime_root.cpp
157
158     bridge/c/CRuntimeObject.cpp
159     bridge/c/c_class.cpp
160     bridge/c/c_instance.cpp
161     bridge/c/c_runtime.cpp
162     bridge/c/c_utility.cpp
163
164     bridge/jsc/BridgeJSC.cpp
165 )
166
167 IF (ENABLE_BLOB)
168     LIST(APPEND WebCore_SOURCES
169         bindings/js/JSFileReaderCustom.cpp
170     )
171 ENDIF ()
172
173 IF (ENABLE_REQUEST_ANIMATION_FRAME)
174     LIST(APPEND WebCore_SOURCES
175         bindings/js/JSRequestAnimationFrameCallbackCustom.cpp
176     )
177 ENDIF ()
178
179 IF (ENABLE_SQL_DATABASE)
180     LIST(APPEND WebCore_SOURCES
181         bindings/js/JSCustomSQLStatementErrorCallback.cpp
182         bindings/js/JSSQLResultSetRowListCustom.cpp
183         bindings/js/JSSQLTransactionCustom.cpp
184         bindings/js/JSSQLTransactionSyncCustom.cpp
185     )
186 ENDIF ()
187
188 IF (ENABLE_INDEXED_DATABASE)
189     LIST(APPEND WebCore_SOURCES
190         bindings/js/IDBBindingUtilities.cpp
191         bindings/js/JSIDBAnyCustom.cpp
192         bindings/js/JSIDBKeyCustom.cpp
193     )
194 ENDIF ()
195
196 IF (ENABLE_WEB_SOCKETS)
197     LIST(APPEND WebCore_SOURCES
198         bindings/js/JSWebSocketCustom.cpp
199     )
200 ENDIF ()
201
202 IF (ENABLE_WORKERS)
203     LIST(APPEND WebCore_SOURCES
204         bindings/js/JSDedicatedWorkerContextCustom.cpp
205         bindings/js/JSWorkerContextBase.cpp
206         bindings/js/JSWorkerContextCustom.cpp
207         bindings/js/JSWorkerCustom.cpp
208         bindings/js/WorkerScriptController.cpp
209         bindings/js/WorkerScriptDebugServer.cpp
210     )
211 ENDIF ()
212
213 IF (ENABLE_SHARED_WORKERS)
214     LIST(APPEND WebCore_SOURCES
215         bindings/js/JSSharedWorkerCustom.cpp
216     )
217 ENDIF ()
218
219 IF (ENABLE_NOTIFICATIONS)
220     LIST(APPEND WebCore_SOURCES
221         bindings/js/JSDesktopNotificationsCustom.cpp
222     )
223 ENDIF ()
224
225 if (ENABLE_FILE_SYSTEM)
226     LIST(APPEND WebCore_SOURCES
227         bindings/js/JSDirectoryEntryCustom.cpp
228         bindings/js/JSDirectoryEntrySyncCustom.cpp
229         bindings/js/JSEntryCustom.cpp
230         bindings/js/JSEntrySyncCustom.cpp
231     )
232 ENDIF ()
233
234 IF (ENABLE_SVG)
235     LIST(APPEND WebCore_SOURCES
236         bindings/js/JSSVGElementInstanceCustom.cpp
237         bindings/js/JSSVGLengthCustom.cpp
238         bindings/js/JSSVGPathSegCustom.cpp
239     )
240 ENDIF ()
241
242 IF (ENABLE_WEBGL)
243     LIST(APPEND WebCore_SOURCES
244         bindings/js/JSWebGLRenderingContextCustom.cpp
245     )
246 ENDIF ()
247
248 LIST(APPEND SCRIPTS_BINDINGS
249     ${WEBCORE_DIR}/bindings/scripts/CodeGenerator.pm
250 )
251
252 SET(IDL_INCLUDES "")
253 FOREACH (_include ${WebCore_IDL_INCLUDES})
254     LIST(APPEND IDL_INCLUDES --include=${WEBCORE_DIR}/${_include})
255 ENDFOREACH ()
256
257 SET(FEATURE_DEFINES_JAVASCRIPT "LANGUAGE_JAVASCRIPT=1")
258 FOREACH (_feature ${FEATURE_DEFINES})
259     SET(FEATURE_DEFINES_JAVASCRIPT "${FEATURE_DEFINES_JAVASCRIPT} ${_feature}")
260 ENDFOREACH ()
261
262 # Create JavaScript C++ code given an IDL input
263 FOREACH (_idl ${WebCore_IDL_FILES})
264     SET(IDL_FILES_LIST "${IDL_FILES_LIST}${WEBCORE_DIR}/${_idl}\n")
265 ENDFOREACH ()
266 FILE(WRITE ${IDL_FILES_TMP} ${IDL_FILES_LIST})
267
268 ADD_CUSTOM_COMMAND(
269     OUTPUT ${SUPPLEMENTAL_DEPENDENCY_FILE}
270     DEPENDS ${WEBCORE_DIR}/bindings/scripts/preprocess-idls.pl ${SCRIPTS_PREPROCESS_IDLS} ${WebCore_IDL_FILES} ${IDL_ATTRIBUTES_FILE}
271     COMMAND ${PERL_EXECUTABLE} -I${WEBCORE_DIR}/bindings/scripts ${WEBCORE_DIR}/bindings/scripts/preprocess-idls.pl --defines "${FEATURE_DEFINES_JAVASCRIPT}" --idlFilesList ${IDL_FILES_TMP} --preprocessor "${CODE_GENERATOR_PREPROCESSOR}" --supplementalDependencyFile ${SUPPLEMENTAL_DEPENDENCY_FILE} --idlAttributesFile ${IDL_ATTRIBUTES_FILE}
272     VERBATIM)
273
274 FOREACH (_file ${WebCore_IDL_FILES})
275     GET_FILENAME_COMPONENT (_name ${_file} NAME_WE)
276     ADD_CUSTOM_COMMAND(
277         OUTPUT  ${DERIVED_SOURCES_WEBCORE_DIR}/JS${_name}.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/JS${_name}.h
278         MAIN_DEPENDENCY ${_file}
279         DEPENDS ${WEBCORE_DIR}/bindings/scripts/generate-bindings.pl ${SCRIPTS_BINDINGS} ${WEBCORE_DIR}/bindings/scripts/CodeGeneratorJS.pm ${SUPPLEMENTAL_DEPENDENCY_FILE}
280         COMMAND ${PERL_EXECUTABLE} -I${WEBCORE_DIR}/bindings/scripts ${WEBCORE_DIR}/bindings/scripts/generate-bindings.pl --defines "${FEATURE_DEFINES_JAVASCRIPT}" --generator JS ${IDL_INCLUDES} --outputDir "${DERIVED_SOURCES_WEBCORE_DIR}" --preprocessor "${CODE_GENERATOR_PREPROCESSOR}" --supplementalDependencyFile ${SUPPLEMENTAL_DEPENDENCY_FILE} ${WEBCORE_DIR}/${_file}
281         VERBATIM)
282     LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/JS${_name}.cpp)
283 ENDFOREACH ()