Replace static_casts with to* functions.
[WebKit-https.git] / Source / WebCore / UseV8.cmake
1 add_definitions(-DUSING_V8_SHARED)
2 add_definitions(-DWTF_CHANGES=1)
3
4 list(APPEND WebCore_INCLUDE_DIRECTORIES
5     "${WEBCORE_DIR}/bindings/v8"
6     "${WEBCORE_DIR}/bindings/v8/custom"
7     "${JAVASCRIPTCORE_DIR}/runtime"
8 )
9
10 list(APPEND WebCoreTestSupport_INCLUDE_DIRECTORIES
11     "${WEBCORE_DIR}/testing/v8"
12 )
13
14 list(APPEND WebCore_IDL_INCLUDES
15     bindings/v8
16 )
17
18 list(APPEND WebCore_SOURCES
19     bindings/generic/BindingSecurity.cpp
20
21     bindings/v8/BindingState.cpp
22     bindings/v8/DOMData.cpp
23     bindings/v8/DOMDataStore.cpp
24     bindings/v8/DOMWrapperWorld.cpp
25     bindings/v8/DateExtension.cpp
26     bindings/v8/IDBBindingUtilities.cpp
27     bindings/v8/Dictionary.cpp
28     bindings/v8/PageScriptDebugServer.cpp
29     bindings/v8/RetainedDOMInfo.cpp
30     bindings/v8/ScheduledAction.cpp
31     bindings/v8/ScopedDOMDataStore.cpp
32     bindings/v8/ScriptCachedFrameData.cpp
33     bindings/v8/ScriptCallStackFactory.cpp
34     bindings/v8/ScriptController.cpp
35     bindings/v8/ScriptEventListener.cpp
36     bindings/v8/ScriptFunctionCall.cpp
37     bindings/v8/ScriptGCEvent.cpp
38     bindings/v8/ScriptInstance.cpp
39     bindings/v8/ScriptObject.cpp
40     bindings/v8/ScriptRunner.cpp
41     bindings/v8/ScriptScope.cpp
42     bindings/v8/ScriptSourceCode.cpp
43     bindings/v8/ScriptState.cpp
44     bindings/v8/ScriptValue.cpp
45     bindings/v8/SerializedScriptValue.cpp
46     bindings/v8/StaticDOMDataStore.cpp
47     bindings/v8/V8AbstractEventListener.cpp
48     bindings/v8/V8Binding.cpp
49     bindings/v8/V8Collection.cpp
50     bindings/v8/V8DOMConfiguration.cpp,
51     bindings/v8/V8DOMWindowShell.cpp
52     bindings/v8/V8DOMWrapper.cpp
53     bindings/v8/V8EventListener.cpp
54     bindings/v8/V8EventListenerList.cpp
55     bindings/v8/V8GCController.cpp
56     bindings/v8/V8GCForContextDispose.cpp
57     bindings/v8/V8HiddenPropertyName.cpp
58     bindings/v8/V8Initializer.cpp
59     bindings/v8/V8LazyEventListener.cpp
60     bindings/v8/V8NodeFilterCondition.cpp
61     bindings/v8/V8ObjectConstructor.cpp
62     bindings/v8/V8PerContextData.cpp
63     bindings/v8/V8PerIsolateData.cpp
64     bindings/v8/V8RecursionScope.cpp
65     bindings/v8/V8ThrowException.cpp
66     bindings/v8/V8Utilities.cpp
67     bindings/v8/V8ValueCache.cpp
68     bindings/v8/V8WindowErrorHandler.cpp
69     bindings/v8/V8WorkerContextErrorHandler.cpp
70     bindings/v8/V8WorkerContextEventListener.cpp
71     bindings/v8/WorkerScriptController.cpp
72     bindings/v8/WorkerScriptDebugServer.cpp
73     bindings/v8/WorldContextHandle.cpp
74     bindings/v8/npruntime.cpp
75
76     bindings/v8/custom/V8ArrayBufferCustom.cpp
77     bindings/v8/custom/V8ArrayBufferViewCustom.cpp
78     bindings/v8/custom/V8AudioContextCustom.cpp
79     bindings/v8/custom/V8BiquadFilterNodeCustom.cpp
80     bindings/v8/custom/V8CSSRuleCustom.cpp
81     bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
82     bindings/v8/custom/V8CSSValueCustom.cpp
83     bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
84     bindings/v8/custom/V8CanvasRenderingContextCustom.cpp
85     bindings/v8/custom/V8ClipboardCustom.cpp
86     bindings/v8/custom/V8ConsoleCustom.cpp
87     bindings/v8/custom/V8CoordinatesCustom.cpp
88     bindings/v8/custom/V8CustomEventCustom.cpp
89     bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
90     bindings/v8/custom/V8CustomXPathNSResolver.cpp
91     bindings/v8/custom/V8DOMFormDataCustom.cpp
92     bindings/v8/custom/V8DOMStringMapCustom.cpp
93     bindings/v8/custom/V8DOMWindowCustom.cpp
94     bindings/v8/custom/V8DataViewCustom.cpp
95     bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp
96     bindings/v8/custom/V8DeviceMotionEventCustom.cpp
97     bindings/v8/custom/V8DeviceOrientationEventCustom.cpp
98     bindings/v8/custom/V8DocumentCustom.cpp
99     bindings/v8/custom/V8DocumentLocationCustom.cpp
100     bindings/v8/custom/V8EntrySyncCustom.cpp
101     bindings/v8/custom/V8EventConstructors.cpp
102     bindings/v8/custom/V8EventCustom.cpp
103     bindings/v8/custom/V8FileReaderCustom.cpp
104     bindings/v8/custom/V8GeolocationCustom.cpp
105     bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
106     bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
107     bindings/v8/custom/V8HTMLCollectionCustom.cpp
108     bindings/v8/custom/V8HTMLDocumentCustom.cpp
109     bindings/v8/custom/V8HTMLElementCustom.cpp
110     bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp
111     bindings/v8/custom/V8HTMLFormElementCustom.cpp
112     bindings/v8/custom/V8HTMLFrameElementCustom.cpp
113     bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp
114     bindings/v8/custom/V8HTMLImageElementConstructor.cpp
115     bindings/v8/custom/V8HTMLInputElementConstructor.cpp
116     bindings/v8/custom/V8HTMLLinkElementCustom.cpp
117     bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
118     bindings/v8/custom/V8HTMLPlugInElementCustom.cpp
119     bindings/v8/custom/V8HTMLSelectElementCustom.cpp
120     bindings/v8/custom/V8HistoryCustom.cpp
121     bindings/v8/custom/V8IDBAnyCustom.cpp
122     bindings/v8/custom/V8ImageDataCustom.cpp
123     bindings/v8/custom/V8InjectedScriptHostCustom.cpp
124     bindings/v8/custom/V8InjectedScriptManager.cpp
125     bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
126     bindings/v8/custom/V8LocationCustom.cpp
127     bindings/v8/custom/V8MessageChannelCustom.cpp
128     bindings/v8/custom/V8MessageEventCustom.cpp
129     bindings/v8/custom/V8MessagePortCustom.cpp
130     bindings/v8/custom/V8MicroDataItemValueCustom.cpp
131     bindings/v8/custom/V8MutationCallbackCustom.cpp
132     bindings/v8/custom/V8MutationObserverCustom.cpp
133     bindings/v8/custom/V8NamedNodeMapCustom.cpp
134     bindings/v8/custom/V8NamedNodesCollection.cpp
135     bindings/v8/custom/V8NodeCustom.cpp
136     bindings/v8/custom/V8NodeListCustom.cpp
137     bindings/v8/custom/V8OscillatorNodeCustom.cpp
138     bindings/v8/custom/V8PerformanceEntryCustom.cpp
139     bindings/v8/custom/V8PannerNodeCustom.cpp
140     bindings/v8/custom/V8PopStateEventCustom.cpp
141     bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
142     bindings/v8/custom/V8SQLTransactionCustom.cpp
143     bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
144     bindings/v8/custom/V8StorageCustom.cpp
145     bindings/v8/custom/V8StringResource.cpp
146     bindings/v8/custom/V8StyleSheetCustom.cpp
147     bindings/v8/custom/V8StyleSheetListCustom.cpp
148     bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
149     bindings/v8/custom/V8WebKitPointCustom.cpp
150     bindings/v8/custom/V8WorkerContextCustom.cpp
151     bindings/v8/custom/V8WorkerCustom.cpp
152     bindings/v8/custom/V8XMLHttpRequestCustom.cpp
153     bindings/v8/custom/V8XSLTProcessorCustom.cpp
154 )
155
156 list(APPEND WebCoreTestSupport_SOURCES
157     testing/v8/WebCoreTestSupport.cpp
158 )
159
160 list(APPEND WebCore_SOURCES
161     ${JAVASCRIPTCORE_DIR}/yarr/YarrInterpreter.cpp
162     ${JAVASCRIPTCORE_DIR}/yarr/YarrJIT.cpp
163     ${JAVASCRIPTCORE_DIR}/yarr/YarrPattern.cpp
164     ${JAVASCRIPTCORE_DIR}/yarr/YarrSyntaxChecker.cpp
165 )
166
167 if (ENABLE_JAVASCRIPT_DEBUGGER)
168     list(APPEND WebCore_SOURCES
169         bindings/v8/JavaScriptCallFrame.cpp
170         bindings/v8/ScriptDebugServer.cpp
171         bindings/v8/ScriptHeapSnapshot.cpp
172         bindings/v8/ScriptProfile.cpp
173         bindings/v8/ScriptProfileNode.cpp
174         bindings/v8/ScriptProfiler.cpp
175
176         bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp
177     )
178 endif ()
179
180 if (ENABLE_NETSCAPE_PLUGIN_API)
181     list(APPEND WebCore_SOURCES
182         bindings/v8/NPV8Object.cpp
183         bindings/v8/V8NPObject.cpp
184         bindings/v8/V8NPUtils.cpp
185     )
186 endif ()
187
188 if (ENABLE_VIDEO)
189     list(APPEND WebCore_SOURCES
190         bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
191     )
192 endif ()
193
194 if (ENABLE_SVG)
195     list(APPEND WebCore_SOURCES
196         bindings/v8/custom/V8SVGDocumentCustom.cpp
197         bindings/v8/custom/V8SVGElementCustom.cpp
198         bindings/v8/custom/V8SVGLengthCustom.cpp
199         bindings/v8/custom/V8SVGPathSegCustom.cpp
200     )
201 endif ()
202
203 list(APPEND SCRIPTS_BINDINGS
204     ${WEBCORE_DIR}/bindings/scripts/CodeGenerator.pm
205     ${WEBCORE_DIR}/bindings/scripts/CodeGeneratorV8.pm
206 )
207
208 set(IDL_INCLUDES "")
209 foreach (_include ${WebCore_IDL_INCLUDES})
210     list(APPEND IDL_INCLUDES --include=${WEBCORE_DIR}/${_include})
211 endforeach ()
212
213 foreach (_include ${WebCoreTestSupport_IDL_INCLUDES})
214     list(APPEND IDL_INCLUDES --include=${WEBCORE_DIR}/${_include})
215 endforeach ()
216
217 set(FEATURE_DEFINES_JAVASCRIPT "LANGUAGE_JAVASCRIPT=1 V8_BINDING=1 ${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}")
218
219 # Generate DebuggerScriptSource.h
220 add_custom_command(
221     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/DebuggerScriptSource.h
222     MAIN_DEPENDENCY ${WEBCORE_DIR}/bindings/v8/DebuggerScript.js
223     DEPENDS ${WEBCORE_DIR}/inspector/xxd.pl
224     COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/inspector/xxd.pl DebuggerScriptSource_js ${WEBCORE_DIR}/bindings/v8/DebuggerScript.js ${DERIVED_SOURCES_WEBCORE_DIR}/DebuggerScriptSource.h
225     VERBATIM)
226 list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/DebuggerScriptSource.h)
227
228 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
229 add_custom_command(
230     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/RegExpJitTables.h
231     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_regex_tables
232     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create_regex_tables > ${DERIVED_SOURCES_WEBCORE_DIR}/RegExpJitTables.h
233     VERBATIM)
234 ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/RegExpJitTables.h)
235
236 # Generate V8ArrayBufferViewCustomScript.h
237 add_custom_command(
238     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/V8ArrayBufferViewCustomScript.h
239     MAIN_DEPENDENCY ${WEBCORE_DIR}/bindings/v8/custom/V8ArrayBufferViewCustomScript.js
240     DEPENDS ${WEBCORE_DIR}/inspector/xxd.pl
241     COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/inspector/xxd.pl V8ArrayBufferViewCustomScript_js ${WEBCORE_DIR}/bindings/v8/custom/V8ArrayBufferViewCustomScript.js ${DERIVED_SOURCES_WEBCORE_DIR}/V8ArrayBufferViewCustomScript.h
242     VERBATIM)
243 list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/V8ArrayBufferViewCustomScript.h)
244
245 # Create JavaScript C++ code given an IDL input
246 foreach (_idl ${WebCore_IDL_FILES})
247     set(IDL_FILES_LIST "${IDL_FILES_LIST}${WEBCORE_DIR}/${_idl}\n")
248 endforeach ()
249
250 foreach (_idl ${WebCoreTestSupport_IDL_FILES})
251     set(IDL_FILES_LIST "${IDL_FILES_LIST}${WEBCORE_DIR}/${_idl}\n")
252 endforeach ()
253
254 set(IDL_FILES_LIST "${IDL_FILES_LIST}${DERIVED_SOURCES_WEBCORE_DIR}/InternalSettingsGenerated.idl\n")
255 list(APPEND WebCoreTestSupport_IDL_FILES ${DERIVED_SOURCES_WEBCORE_DIR}/InternalSettingsGenerated.idl)
256 list(APPEND IDL_INCLUDES --include=${DERIVED_SOURCES_WEBCORE_DIR})
257
258 file(WRITE ${IDL_FILES_TMP} ${IDL_FILES_LIST})
259
260 add_custom_command(
261     OUTPUT ${SUPPLEMENTAL_DEPENDENCY_FILE}
262     DEPENDS ${WEBCORE_DIR}/bindings/scripts/preprocess-idls.pl ${SCRIPTS_PREPROCESS_IDLS} ${WebCore_IDL_FILES} ${WebCoreTestSupport_IDL_FILES} ${IDL_ATTRIBUTES_FILE}
263     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}
264     VERBATIM)
265
266 GENERATE_BINDINGS(WebCore_SOURCES
267     "${WebCore_IDL_FILES}"
268     "${WEBCORE_DIR}"
269     "${IDL_INCLUDES}"
270     "${FEATURE_DEFINES_JAVASCRIPT}"
271     ${DERIVED_SOURCES_WEBCORE_DIR} V8 V8
272     ${IDL_ATTRIBUTES_FILE}
273     ${SUPPLEMENTAL_DEPENDENCY_FILE})
274
275 GENERATE_BINDINGS(WebCoreTestSupport_SOURCES
276     "${WebCoreTestSupport_IDL_FILES}"
277     "${WEBCORE_DIR}"
278     "${IDL_INCLUDES}"
279     "${FEATURE_DEFINES_JAVASCRIPT}"
280     ${DERIVED_SOURCES_WEBCORE_DIR} V8 V8
281     ${IDL_ATTRIBUTES_FILE}
282     ${SUPPLEMENTAL_DEPENDENCY_FILE})