d04740bf141d32996c62f585b28bc4ccb435d800
[WebKit-https.git] / Source / JavaScriptCore / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8.12)
2 include(WebKitCommon)
3 set_property(DIRECTORY . PROPERTY FOLDER "JavaScriptCore")
4
5 list(APPEND JavaScriptCore_UNIFIED_SOURCE_LIST_FILES
6     "Sources.txt"
7 )
8
9 set(JavaScriptCore_INCLUDE_DIRECTORIES
10     "${FORWARDING_HEADERS_DIR}"
11 )
12
13 set(JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES
14     "${CMAKE_BINARY_DIR}"
15     "${JAVASCRIPTCORE_DIR}"
16     "${JAVASCRIPTCORE_DIR}/API"
17     "${JAVASCRIPTCORE_DIR}/assembler"
18     "${JAVASCRIPTCORE_DIR}/b3"
19     "${JAVASCRIPTCORE_DIR}/b3/air"
20     "${JAVASCRIPTCORE_DIR}/bindings"
21     "${JAVASCRIPTCORE_DIR}/builtins"
22     "${JAVASCRIPTCORE_DIR}/bytecode"
23     "${JAVASCRIPTCORE_DIR}/bytecompiler"
24     "${JAVASCRIPTCORE_DIR}/dfg"
25     "${JAVASCRIPTCORE_DIR}/disassembler"
26     "${JAVASCRIPTCORE_DIR}/disassembler/ARM64"
27     "${JAVASCRIPTCORE_DIR}/disassembler/udis86"
28     "${JAVASCRIPTCORE_DIR}/domjit"
29     "${JAVASCRIPTCORE_DIR}/ftl"
30     "${JAVASCRIPTCORE_DIR}/heap"
31     "${JAVASCRIPTCORE_DIR}/debugger"
32     "${JAVASCRIPTCORE_DIR}/inspector"
33     "${JAVASCRIPTCORE_DIR}/inspector/agents"
34     "${JAVASCRIPTCORE_DIR}/inspector/augmentable"
35     "${JAVASCRIPTCORE_DIR}/inspector/remote"
36     "${JAVASCRIPTCORE_DIR}/interpreter"
37     "${JAVASCRIPTCORE_DIR}/jit"
38     "${JAVASCRIPTCORE_DIR}/llint"
39     "${JAVASCRIPTCORE_DIR}/parser"
40     "${JAVASCRIPTCORE_DIR}/profiler"
41     "${JAVASCRIPTCORE_DIR}/runtime"
42     "${JAVASCRIPTCORE_DIR}/tools"
43     "${JAVASCRIPTCORE_DIR}/wasm"
44     "${JAVASCRIPTCORE_DIR}/wasm/js"
45     "${JAVASCRIPTCORE_DIR}/yarr"
46     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
47     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector"
48     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/runtime"
49     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr"
50 )
51
52 if (USE_CAPSTONE)
53     list(APPEND JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/capstone/Source/include")
54 endif ()
55
56 set(JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES
57     "${ICU_INCLUDE_DIRS}"
58 )
59
60 set(JavaScriptCore_OBJECT_LUT_SOURCES
61     runtime/ArrayConstructor.cpp
62     runtime/ArrayIteratorPrototype.cpp
63     runtime/AsyncFromSyncIteratorPrototype.cpp
64     runtime/AsyncGeneratorPrototype.cpp
65     runtime/BigIntConstructor.cpp
66     runtime/BigIntPrototype.cpp
67     runtime/BooleanPrototype.cpp
68     runtime/DateConstructor.cpp
69     runtime/DatePrototype.cpp
70     runtime/ErrorPrototype.cpp
71     runtime/GeneratorPrototype.cpp
72     runtime/InspectorInstrumentationObject.cpp
73     runtime/IntlCollatorConstructor.cpp
74     runtime/IntlCollatorPrototype.cpp
75     runtime/IntlDateTimeFormatConstructor.cpp
76     runtime/IntlDateTimeFormatPrototype.cpp
77     runtime/IntlNumberFormatConstructor.cpp
78     runtime/IntlNumberFormatPrototype.cpp
79     runtime/IntlObject.cpp
80     runtime/IntlPluralRulesConstructor.cpp
81     runtime/IntlPluralRulesPrototype.cpp
82     runtime/JSDataViewPrototype.cpp
83     runtime/JSGlobalObject.cpp
84     runtime/JSInternalPromiseConstructor.cpp
85     runtime/JSModuleLoader.cpp
86     runtime/JSONObject.cpp
87     runtime/JSPromiseConstructor.cpp
88     runtime/JSPromisePrototype.cpp
89     runtime/MapPrototype.cpp
90     runtime/NumberConstructor.cpp
91     runtime/NumberPrototype.cpp
92     runtime/ObjectConstructor.cpp
93     runtime/ReflectObject.cpp
94     runtime/RegExpConstructor.cpp
95     runtime/RegExpPrototype.cpp
96     runtime/SetPrototype.cpp
97     runtime/StringConstructor.cpp
98     runtime/StringIteratorPrototype.cpp
99     runtime/StringPrototype.cpp
100     runtime/SymbolConstructor.cpp
101     runtime/SymbolPrototype.cpp
102
103     wasm/js/WebAssemblyCompileErrorConstructor.cpp
104     wasm/js/WebAssemblyCompileErrorPrototype.cpp
105     wasm/js/WebAssemblyInstanceConstructor.cpp
106     wasm/js/WebAssemblyInstancePrototype.cpp
107     wasm/js/WebAssemblyLinkErrorConstructor.cpp
108     wasm/js/WebAssemblyLinkErrorPrototype.cpp
109     wasm/js/WebAssemblyMemoryConstructor.cpp
110     wasm/js/WebAssemblyMemoryPrototype.cpp
111     wasm/js/WebAssemblyModuleConstructor.cpp
112     wasm/js/WebAssemblyModulePrototype.cpp
113     wasm/js/WebAssemblyPrototype.cpp
114     wasm/js/WebAssemblyRuntimeErrorConstructor.cpp
115     wasm/js/WebAssemblyRuntimeErrorPrototype.cpp
116     wasm/js/WebAssemblyTableConstructor.cpp
117     wasm/js/WebAssemblyTablePrototype.cpp
118 )
119
120 set(JavaScriptCore_LIBRARIES
121     WTF${DEBUG_SUFFIX}
122     ${ICU_I18N_LIBRARIES}
123 )
124
125 if (USE_CAPSTONE)
126     list(APPEND JavaScriptCore_LIBRARIES capstone)
127 endif ()
128
129 if (ATOMIC_INT64_REQUIRES_LIBATOMIC)
130     list(APPEND JavaScriptCore_LIBRARIES atomic)
131 endif ()
132
133 set(JavaScriptCore_SCRIPTS_SOURCES_DIR "${JAVASCRIPTCORE_DIR}/Scripts")
134
135 # Globbing relies on the fact that generator-specific file names are prefixed with their directory.
136 # Top-level scripts should have a file extension, since they are invoked during the build.
137
138 set(JavaScriptCore_SCRIPTS_SOURCES_PATHS
139     ${JavaScriptCore_SCRIPTS_SOURCES_DIR}/*.pl
140     ${JavaScriptCore_SCRIPTS_SOURCES_DIR}/*.py
141     ${JavaScriptCore_SCRIPTS_SOURCES_DIR}/wkbuiltins/builtins*.py
142     ${JavaScriptCore_SCRIPTS_SOURCES_DIR}/wkbuiltins/wkbuiltins.py
143 )
144
145 # Force JavaScriptCore to run scripts from the same staging path as WebCore.
146 set(JavaScriptCore_SCRIPTS_DIR "${FORWARDING_HEADERS_DIR}/JavaScriptCore/Scripts")
147
148 file(MAKE_DIRECTORY ${JavaScriptCore_SCRIPTS_DIR})
149
150 # The directory flattening performed below mirrors what the Mac port does with private headers.
151
152 file(GLOB JavaScriptCore_SCRIPTS_SOURCES ${JavaScriptCore_SCRIPTS_SOURCES_PATHS})
153
154 foreach (_file ${JavaScriptCore_SCRIPTS_SOURCES})
155     get_filename_component(_script "${_file}" NAME)
156     add_custom_command(
157         OUTPUT ${JavaScriptCore_SCRIPTS_DIR}/${_script}
158         MAIN_DEPENDENCY ${_file}
159         WORKING_DIRECTORY ${DERIVED_SOURCES_DIR}
160         COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_file} ${JavaScriptCore_SCRIPTS_DIR}/${_script}
161         VERBATIM)
162     list(APPEND JavaScriptCore_SCRIPTS ${JavaScriptCore_SCRIPTS_DIR}/${_script})
163 endforeach ()
164
165 set(UDIS_GEN_DEP
166     disassembler/udis86/optable.xml
167     disassembler/udis86/ud_itab.py
168     disassembler/udis86/ud_opcode.py
169 )
170
171 add_custom_command(
172     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.c ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
173     DEPENDS ${UDIS_GEN_DEP}
174     WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
175     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/disassembler/udis86/ud_itab.py ${JAVASCRIPTCORE_DIR}/disassembler/udis86/optable.xml ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
176     VERBATIM)
177
178 list(APPEND JavaScriptCore_HEADERS
179     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
180 )
181
182 set(LLINT_ASM
183     llint/LowLevelInterpreter.asm
184     llint/LowLevelInterpreter32_64.asm
185     llint/LowLevelInterpreter64.asm
186 )
187
188 set(OFFLINE_ASM
189     offlineasm/arm.rb
190     offlineasm/arm64.rb
191     offlineasm/ast.rb
192     offlineasm/backends.rb
193     offlineasm/cloop.rb
194     offlineasm/config.rb
195     offlineasm/instructions.rb
196     offlineasm/mips.rb
197     offlineasm/offsets.rb
198     offlineasm/opt.rb
199     offlineasm/parser.rb
200     offlineasm/registers.rb
201     offlineasm/risc.rb
202     offlineasm/self_hash.rb
203     offlineasm/settings.rb
204     offlineasm/transform.rb
205     offlineasm/x86.rb
206 )
207
208 set(GENERATOR
209     generator/Argument.rb
210     generator/Assertion.rb
211     generator/DSL.rb
212     generator/Fits.rb
213     generator/GeneratedFile.rb
214     generator/Metadata.rb
215     generator/Opcode.rb
216     generator/OpcodeGroup.rb
217     generator/Options.rb
218     generator/Section.rb
219     generator/Template.rb
220     generator/Type.rb
221     generator/main.rb
222 )
223
224 add_custom_command(
225     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeIndices.h
226     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/generator/main.rb
227     DEPENDS ${GENERATOR} bytecode/BytecodeList.rb
228     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/generator/main.rb --bytecodes_h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h --init_bytecodes_asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm --bytecode_structs_h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h --bytecode_indices_h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeIndices.h ${JAVASCRIPTCORE_DIR}/bytecode/BytecodeList.rb
229     VERBATIM)
230
231 list(APPEND JavaScriptCore_HEADERS
232     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
233     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h
234 )
235
236 if (WIN32)
237   set(OFFLINE_ASM_BACKEND "X86_WIN, X86_64_WIN, C_LOOP")
238 else ()
239     if (WTF_CPU_X86)
240         set(OFFLINE_ASM_BACKEND "X86")
241     elseif (WTF_CPU_X86_64)
242         set(OFFLINE_ASM_BACKEND "X86_64")
243     elseif (WTF_CPU_ARM64)
244         set(OFFLINE_ASM_BACKEND "ARM64")
245     elseif (ARM_THUMB2_DETECTED)
246         set(OFFLINE_ASM_BACKEND "ARMv7")
247     elseif (WTF_CPU_MIPS)
248         set(OFFLINE_ASM_BACKEND "MIPS")
249     endif ()
250
251     if (NOT ENABLE_JIT)
252         if (ENABLE_C_LOOP)
253             set(OFFLINE_ASM_BACKEND "C_LOOP")
254         endif ()
255     endif ()
256 endif ()
257
258 add_custom_command(
259     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredSettings.h
260     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_settings_extractor.rb
261     DEPENDS ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
262     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_settings_extractor.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredSettings.h ${OFFLINE_ASM_BACKEND}
263     VERBATIM)
264
265 add_custom_command(
266     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
267     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb
268     DEPENDS LLIntSettingsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
269     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntSettingsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${OFFLINE_ASM_BACKEND}
270     VERBATIM)
271
272 # We add the header files directly to the ADD_EXECUTABLE call instead of setting the
273 # OBJECT_DEPENDS property in LLIntOffsetsExtractor.cpp because generate_offset_extractor.rb and
274 # generate-bytecode-files may not regenerate the .h files in case the hash it calculates does not change.
275 # In this case, if some of the dependencies specified in the ADD_CUSTOM_COMMANDs above have
276 # changed the command will always be called because the mtime of the .h files will
277 # always be older than that of their dependencies.
278 # Additionally, setting the OBJECT_DEPENDS property will make the .h files a Makefile
279 # dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will
280 # actually be run multiple times!
281 add_executable(LLIntSettingsExtractor
282     ${JAVASCRIPTCORE_DIR}/llint/LLIntSettingsExtractor.cpp
283     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredSettings.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h
284 )
285
286 add_executable(LLIntOffsetsExtractor
287     ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
288     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h
289 )
290
291 target_link_libraries(LLIntSettingsExtractor WTF)
292 add_dependencies(LLIntSettingsExtractor JavaScriptCoreForwardingHeaders)
293 target_link_libraries(LLIntOffsetsExtractor WTF)
294 add_dependencies(LLIntOffsetsExtractor JavaScriptCoreForwardingHeaders)
295
296 # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than
297 # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization
298 # that generates a checksum of the LLIntOffsetsExtractor binary, if the checksum of the new
299 # LLIntOffsetsExtractor matches, no output is generated. To make this target consistent and avoid
300 # running this command for every build, we artificially update LLIntAssembly.h's mtime (using touch)
301 # after every asm.rb run.
302 if (MSVC AND NOT ENABLE_C_LOOP)
303     set(LLIntOutput LowLevelInterpreterWin.asm)
304     set(OFFLINE_ASM_ARGS --assembler=MASM)
305 else ()
306     set(LLIntOutput LLIntAssembly.h)
307 endif ()
308
309 add_custom_command(
310     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
311     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb
312     DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
313     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput} ${OFFLINE_ASM_ARGS}
314     COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
315     WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
316     VERBATIM)
317
318 # The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of
319 # the .cpp files below is similar to the one in the previous comment. However, since these .cpp
320 # files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS
321 # since it is used in the add_library() call at the end of this file.
322 if (MSVC AND NOT ENABLE_C_LOOP)
323     enable_language(ASM_MASM)
324     if (CMAKE_SIZEOF_VOID_P EQUAL 4)
325         # Win32 needs /safeseh with assembly, but Win64 does not.
326         set(MASM_EXECUTABLE ml)
327         set(LLINT_MASM_FLAGS /safeseh /c /Fo)
328     else ()
329         set(MASM_EXECUTABLE ml64)
330         set(LLINT_MASM_FLAGS /c /Fo)
331     endif ()
332     add_custom_command(
333         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.obj
334         DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.asm
335         COMMAND ${MASM_EXECUTABLE} ${LLINT_MASM_FLAGS} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.obj ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.asm
336         VERBATIM)
337     list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.obj)
338 else ()
339     list(APPEND JavaScriptCore_HEADERS
340         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
341     )
342 endif ()
343
344 # WebAssembly generator
345
346 macro(GENERATE_PYTHON _generator _additional_deps _input _output)
347     add_custom_command(
348         OUTPUT ${_output}
349         MAIN_DEPENDENCY ${_generator}
350         DEPENDS ${_input} ${_additional_deps}
351         COMMAND ${PYTHON_EXECUTABLE} ${_generator} ${_input} ${_output}
352         VERBATIM)
353     list(APPEND JavaScriptCore_HEADERS ${_output})
354     WEBKIT_ADD_SOURCE_DEPENDENCIES(${_input} ${_output})
355 endmacro()
356 GENERATE_PYTHON(${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasmOpsHeader.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasm.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/wasm.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WasmOps.h)
357 GENERATE_PYTHON(${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasmValidateInlinesHeader.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasm.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/wasm.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WasmValidateInlines.h)
358 GENERATE_PYTHON(${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasmB3IRGeneratorInlinesHeader.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasm.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/wasm.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WasmB3IRGeneratorInlines.h)
359
360 # LUT generator
361
362 set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table)
363 macro(GENERATE_HASH_LUT _input _output)
364     add_custom_command(
365         OUTPUT ${_output}
366         MAIN_DEPENDENCY ${HASH_LUT_GENERATOR}
367         DEPENDS ${_input}
368         COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} > ${_output}
369         VERBATIM)
370     list(APPEND JavaScriptCore_HEADERS ${_output})
371     WEBKIT_ADD_SOURCE_DEPENDENCIES(${_input} ${_output})
372 endmacro()
373
374 # GENERATOR 1-A: LUT creator
375
376 foreach (_file ${JavaScriptCore_OBJECT_LUT_SOURCES})
377     get_filename_component(_name ${_file} NAME_WE)
378     GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
379 endforeach ()
380
381 set(JavaScriptCore_PUBLIC_FRAMEWORK_HEADERS
382     API/JSBase.h
383     API/JSContextRef.h
384     API/JSObjectRef.h
385     API/JSStringRef.h
386     API/JSTypedArray.h
387     API/JSValueRef.h
388     API/JavaScript.h
389     API/WebKitAvailability.h
390 )
391
392 set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
393     API/APICallbackFunction.h
394     API/APICast.h
395     API/APIUtils.h
396     API/JSAPIValueWrapper.h
397     API/JSAPIWrapperObject.h
398     API/JSBasePrivate.h
399     API/JSCTestRunnerUtils.h
400     API/JSCallbackConstructor.h
401     API/JSCallbackFunction.h
402     API/JSCallbackObject.h
403     API/JSCallbackObjectFunctions.h
404     API/JSClassRef.h
405     API/JSContextInternal.h
406     API/JSContextPrivate.h
407     API/JSContextRefInspectorSupport.h
408     API/JSContextRefInternal.h
409     API/JSContextRefPrivate.h
410     API/JSHeapFinalizerPrivate.h
411     API/JSManagedValueInternal.h
412     API/JSMarkingConstraintPrivate.h
413     API/JSObjectRefPrivate.h
414     API/JSRemoteInspector.h
415     API/JSRetainPtr.h
416     API/JSScriptRefPrivate.h
417     API/JSStringRefPrivate.h
418     API/JSValueInternal.h
419     API/JSVirtualMachineInternal.h
420     API/JSWeakObjectMapRefInternal.h
421     API/JSWeakObjectMapRefPrivate.h
422     API/JSWeakPrivate.h
423     API/JSWrapperMap.h
424     API/ObjCCallbackFunction.h
425     API/ObjcRuntimeExtras.h
426     API/OpaqueJSString.h
427
428     assembler/ARM64Assembler.h
429     assembler/ARMv7Assembler.h
430     assembler/AbortReason.h
431     assembler/AbstractMacroAssembler.h
432     assembler/AssemblerBuffer.h
433     assembler/AssemblerBufferWithConstantPool.h
434     assembler/AssemblerCommon.h
435     assembler/CPU.h
436     assembler/CodeLocation.h
437     assembler/LinkBuffer.h
438     assembler/MIPSAssembler.h
439     assembler/MacroAssembler.h
440     assembler/MacroAssemblerARM64.h
441     assembler/MacroAssemblerARMv7.h
442     assembler/MacroAssemblerCodeRef.h
443     assembler/MacroAssemblerHelpers.h
444     assembler/MacroAssemblerMIPS.h
445     assembler/MacroAssemblerX86.h
446     assembler/MacroAssemblerX86Common.h
447     assembler/MacroAssemblerX86_64.h
448     assembler/Printer.h
449     assembler/X86Assembler.h
450
451     bindings/ScriptFunctionCall.h
452     bindings/ScriptObject.h
453     bindings/ScriptValue.h
454
455     builtins/BuiltinNames.h
456     builtins/BuiltinUtils.h
457
458     bytecode/ArrayAllocationProfile.h
459     bytecode/ArrayProfile.h
460     bytecode/ByValInfo.h
461     bytecode/BytecodeConventions.h
462     bytecode/BytecodeIntrinsicRegistry.h
463     bytecode/CallEdge.h
464     bytecode/CallLinkInfo.h
465     bytecode/CallMode.h
466     bytecode/CallVariant.h
467     bytecode/CodeBlock.h
468     bytecode/CodeBlockHash.h
469     bytecode/CodeOrigin.h
470     bytecode/CodeType.h
471     bytecode/DFGExitProfile.h
472     bytecode/DataFormat.h
473     bytecode/DirectEvalCodeCache.h
474     bytecode/ExecutableInfo.h
475     bytecode/ExecutableToCodeBlockEdge.h
476     bytecode/ExecutionCounter.h
477     bytecode/ExitKind.h
478     bytecode/ExitingInlineKind.h
479     bytecode/ExitingJITType.h
480     bytecode/ExpressionRangeInfo.h
481     bytecode/HandlerInfo.h
482     bytecode/ICStatusMap.h
483     bytecode/InlineCallFrame.h
484     bytecode/Instruction.h
485     bytecode/InstructionStream.h
486     bytecode/InternalFunctionAllocationProfile.h
487     bytecode/JumpTable.h
488     bytecode/LLIntCallLinkInfo.h
489     bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h
490     bytecode/LazyOperandValueProfile.h
491     bytecode/MetadataTable.h
492     bytecode/ObjectAllocationProfile.h
493     bytecode/ObjectPropertyCondition.h
494     bytecode/Opcode.h
495     bytecode/OpcodeSize.h
496     bytecode/PropertyCondition.h
497     bytecode/PutByIdFlags.h
498     bytecode/SpecialPointer.h
499     bytecode/SpeculatedType.h
500     bytecode/StructureSet.h
501     bytecode/SuperSampler.h
502     bytecode/ToThisStatus.h
503     bytecode/TypeLocation.h
504     bytecode/UnlinkedCodeBlock.h
505     bytecode/UnlinkedEvalCodeBlock.h
506     bytecode/UnlinkedFunctionExecutable.h
507     bytecode/UnlinkedGlobalCodeBlock.h
508     bytecode/UnlinkedMetadataTable.h
509     bytecode/ValueProfile.h
510     bytecode/ValueRecovery.h
511     bytecode/VariableWriteFireDetail.h
512     bytecode/VirtualRegister.h
513     bytecode/Watchpoint.h
514
515     debugger/Breakpoint.h
516     debugger/Debugger.h
517     debugger/DebuggerCallFrame.h
518     debugger/DebuggerParseData.h
519     debugger/DebuggerPrimitives.h
520
521     dfg/DFGCommon.h
522     dfg/DFGCompilationMode.h
523     dfg/DFGMinifiedID.h
524
525     domjit/DOMJITAbstractHeap.h
526     domjit/DOMJITCallDOMGetterSnippet.h
527     domjit/DOMJITEffect.h
528     domjit/DOMJITGetterSetter.h
529     domjit/DOMJITHeapRange.h
530     domjit/DOMJITSignature.h
531
532     heap/AlignedMemoryAllocator.h
533     heap/AllocationFailureMode.h
534     heap/Allocator.h
535     heap/AllocatorInlines.h
536     heap/AllocatorForMode.h
537     heap/BlockDirectory.h
538     heap/BlockDirectoryInlines.h
539     heap/CellAttributes.h
540     heap/CellContainer.h
541     heap/CellContainerInlines.h
542     heap/CellState.h
543     heap/CollectionScope.h
544     heap/CollectorPhase.h
545     heap/CompleteSubspace.h
546     heap/CompleteSubspaceInlines.h
547     heap/ConstraintConcurrency.h
548     heap/ConstraintParallelism.h
549     heap/ConstraintVolatility.h
550     heap/DeferGC.h
551     heap/DeleteAllCodeEffort.h
552     heap/DestructionMode.h
553     heap/FastMallocAlignedMemoryAllocator.h
554     heap/FreeList.h
555     heap/FreeListInlines.h
556     heap/GCActivityCallback.h
557     heap/GCAssertions.h
558     heap/GCConductor.h
559     heap/GCDeferralContext.h
560     heap/GCIncomingRefCounted.h
561     heap/GCIncomingRefCountedInlines.h
562     heap/GCIncomingRefCountedSet.h
563     heap/GCLogging.h
564     heap/GCRequest.h
565     heap/GCSegmentedArray.h
566     heap/Handle.h
567     heap/HandleBlock.h
568     heap/HandleSet.h
569     heap/HandleTypes.h
570     heap/Heap.h
571     heap/HeapCell.h
572     heap/HeapCellInlines.h
573     heap/HeapCellType.h
574     heap/HeapFinalizerCallback.h
575     heap/HeapInlines.h
576     heap/HeapObserver.h
577     heap/HeapSnapshotBuilder.h
578     heap/IncrementalSweeper.h
579     heap/IsoCellSet.h
580     heap/IsoSubspace.h
581     heap/IsoSubspaceInlines.h
582     heap/IsoSubspacePerVM.h
583     heap/LargeAllocation.h
584     heap/LocalAllocator.h
585     heap/LocalAllocatorInlines.h
586     heap/LockDuringMarking.h
587     heap/MachineStackMarker.h
588     heap/MarkStack.h
589     heap/MarkedBlock.h
590     heap/MarkedBlockInlines.h
591     heap/MarkedBlockSet.h
592     heap/MarkedSpace.h
593     heap/MarkingConstraint.h
594     heap/MutatorState.h
595     heap/RegisterState.h
596     heap/RunningScope.h
597     heap/SimpleMarkingConstraint.h
598     heap/SlotVisitor.h
599     heap/SlotVisitorInlines.h
600     heap/Strong.h
601     heap/StrongInlines.h
602     heap/Subspace.h
603     heap/SubspaceInlines.h
604     heap/Synchronousness.h
605     heap/TinyBloomFilter.h
606     heap/VisitRaceKey.h
607     heap/Weak.h
608     heap/WeakBlock.h
609     heap/WeakHandleOwner.h
610     heap/WeakImpl.h
611     heap/WeakInlines.h
612     heap/WeakSet.h
613     heap/WeakSetInlines.h
614
615     inspector/ConsoleMessage.h
616     inspector/ContentSearchUtilities.h
617     inspector/IdentifiersFactory.h
618     inspector/InjectedScript.h
619     inspector/InjectedScriptBase.h
620     inspector/InjectedScriptHost.h
621     inspector/InjectedScriptManager.h
622     inspector/InjectedScriptModule.h
623     inspector/InspectorAgentBase.h
624     inspector/InspectorAgentRegistry.h
625     inspector/InspectorBackendDispatcher.h
626     inspector/InspectorEnvironment.h
627     inspector/InspectorFrontendChannel.h
628     inspector/InspectorFrontendRouter.h
629     inspector/InspectorProtocolTypes.h
630     inspector/InspectorTarget.h
631     inspector/PerGlobalObjectWrapperWorld.h
632     inspector/ScriptArguments.h
633     inspector/ScriptBreakpoint.h
634     inspector/ScriptCallFrame.h
635     inspector/ScriptCallStack.h
636     inspector/ScriptCallStackFactory.h
637     inspector/ScriptDebugListener.h
638     inspector/ScriptDebugServer.h
639
640     inspector/agents/InspectorAgent.h
641     inspector/agents/InspectorAuditAgent.h
642     inspector/agents/InspectorConsoleAgent.h
643     inspector/agents/InspectorDebuggerAgent.h
644     inspector/agents/InspectorHeapAgent.h
645     inspector/agents/InspectorRuntimeAgent.h
646     inspector/agents/InspectorScriptProfilerAgent.h
647     inspector/agents/InspectorTargetAgent.h
648
649     inspector/augmentable/AugmentableInspectorControllerClient.h
650
651     inspector/remote/RemoteAutomationTarget.h
652     inspector/remote/RemoteControllableTarget.h
653     inspector/remote/RemoteInspectionTarget.h
654     inspector/remote/RemoteInspector.h
655
656     interpreter/AbstractPC.h
657     interpreter/CallFrame.h
658     interpreter/CallFrameInlines.h
659     interpreter/CalleeBits.h
660     interpreter/EntryFrame.h
661     interpreter/FrameTracers.h
662     interpreter/Register.h
663     interpreter/ShadowChicken.h
664     interpreter/StackVisitor.h
665     interpreter/VMEntryRecord.h
666
667     jit/AssemblyHelpers.h
668     jit/CCallHelpers.h
669     jit/ExecutableAllocator.h
670     jit/FPRInfo.h
671     jit/GCAwareJITStubRoutine.h
672     jit/GPRInfo.h
673     jit/JITAllocator.h
674     jit/JITCode.h
675     jit/JITCodeMap.h
676     jit/JITCompilationEffort.h
677     jit/JITMathICForwards.h
678     jit/JITOperations.h
679     jit/JITStubRoutine.h
680     jit/JITThunks.h
681     jit/PolymorphicCallStubRoutine.h
682     jit/Reg.h
683     jit/RegisterAtOffset.h
684     jit/RegisterAtOffsetList.h
685     jit/RegisterSet.h
686     jit/Snippet.h
687     jit/SnippetParams.h
688     jit/SnippetReg.h
689     jit/SnippetSlowPathCalls.h
690     jit/SpillRegistersMode.h
691     jit/TagRegistersMode.h
692     jit/TempRegisterSet.h
693     jit/ThunkGenerator.h
694     jit/UnusedPointer.h
695
696     llint/LLIntOpcode.h
697
698     parser/Lexer.h
699     parser/ParserArena.h
700     parser/ParserError.h
701     parser/ParserModes.h
702     parser/ParserTokens.h
703     parser/SourceCode.h
704     parser/SourceProvider.h
705     parser/SourceProviderCache.h
706     parser/SourceProviderCacheItem.h
707     parser/UnlinkedSourceCode.h
708     parser/VariableEnvironment.h
709
710     profiler/ProfilerBytecode.h
711     profiler/ProfilerBytecodeSequence.h
712     profiler/ProfilerBytecodes.h
713     profiler/ProfilerCompilation.h
714     profiler/ProfilerCompilationKind.h
715     profiler/ProfilerCompiledBytecode.h
716     profiler/ProfilerDatabase.h
717     profiler/ProfilerEvent.h
718     profiler/ProfilerExecutionCounter.h
719     profiler/ProfilerJettisonReason.h
720     profiler/ProfilerOSRExit.h
721     profiler/ProfilerOSRExitSite.h
722     profiler/ProfilerOrigin.h
723     profiler/ProfilerOriginStack.h
724     profiler/ProfilerProfiledBytecodes.h
725     profiler/ProfilerUID.h
726
727     runtime/AbstractModuleRecord.h
728     runtime/ArgList.h
729     runtime/ArityCheckMode.h
730     runtime/ArrayBuffer.h
731     runtime/ArrayBufferSharingMode.h
732     runtime/ArrayBufferView.h
733     runtime/ArrayConventions.h
734     runtime/ArrayPrototype.h
735     runtime/ArrayStorage.h
736     runtime/AuxiliaryBarrier.h
737     runtime/AuxiliaryBarrierInlines.h
738     runtime/BasicBlockLocation.h
739     runtime/BatchedTransitionOptimizer.h
740     runtime/BigIntPrototype.h
741     runtime/BooleanObject.h
742     runtime/BooleanPrototype.h
743     runtime/Butterfly.h
744     runtime/ButterflyInlines.h
745     runtime/CagedBarrierPtr.h
746     runtime/CallData.h
747     runtime/CatchScope.h
748     runtime/ClassInfo.h
749     runtime/CodeSpecializationKind.h
750     runtime/CommonIdentifiers.h
751     runtime/CompilationResult.h
752     runtime/Completion.h
753     runtime/ConcurrentJSLock.h
754     runtime/ConfigFile.h
755     runtime/ConsoleClient.h
756     runtime/ConsoleTypes.h
757     runtime/ConstantMode.h
758     runtime/ConstructAbility.h
759     runtime/ConstructData.h
760     runtime/ControlFlowProfiler.h
761     runtime/CustomGetterSetter.h
762     runtime/DOMAnnotation.h
763     runtime/DOMAttributeGetterSetter.h
764     runtime/DataView.h
765     runtime/DateInstance.h
766     runtime/DateInstanceCache.h
767     runtime/DefinePropertyAttributes.h
768     runtime/DirectArgumentsOffset.h
769     runtime/DirectEvalExecutable.h
770     runtime/DisallowScope.h
771     runtime/DisallowVMReentry.h
772     runtime/DumpContext.h
773     runtime/EnumerationMode.h
774     runtime/Error.h
775     runtime/ErrorHandlingScope.h
776     runtime/ErrorInstance.h
777     runtime/ErrorPrototype.h
778     runtime/ErrorType.h
779     runtime/EvalExecutable.h
780     runtime/Exception.h
781     runtime/ExceptionEventLocation.h
782     runtime/ExceptionHelpers.h
783     runtime/ExceptionScope.h
784     runtime/ExecutableBase.h
785     runtime/Float32Array.h
786     runtime/Float64Array.h
787     runtime/FunctionConstructor.h
788     runtime/FunctionExecutable.h
789     runtime/FunctionHasExecutedCache.h
790     runtime/FunctionPrototype.h
791     runtime/FunctionRareData.h
792     runtime/GenericOffset.h
793     runtime/GenericTypedArrayView.h
794     runtime/GenericTypedArrayViewInlines.h
795     runtime/GetPutInfo.h
796     runtime/HashMapImpl.h
797     runtime/Identifier.h
798     runtime/IdentifierInlines.h
799     runtime/IndexingHeader.h
800     runtime/IndexingHeaderInlines.h
801     runtime/IndexingType.h
802     runtime/InferredValue.h
803     runtime/InitializeThreading.h
804     runtime/Int16Array.h
805     runtime/Int32Array.h
806     runtime/Int8Array.h
807     runtime/InternalFunction.h
808     runtime/Intrinsic.h
809     runtime/IterationKind.h
810     runtime/IterationStatus.h
811     runtime/IteratorOperations.h
812     runtime/IteratorPrototype.h
813     runtime/JSArray.h
814     runtime/JSArrayBuffer.h
815     runtime/JSArrayBufferPrototype.h
816     runtime/JSArrayBufferView.h
817     runtime/JSArrayBufferViewInlines.h
818     runtime/JSBigInt.h
819     runtime/JSCInlines.h
820     runtime/JSCJSValue.h
821     runtime/JSCJSValueInlines.h
822     runtime/JSCPoison.h
823     runtime/JSCPtrTag.h
824     runtime/JSCallee.h
825     runtime/JSCast.h
826     runtime/JSCell.h
827     runtime/JSCellInlines.h
828     runtime/JSDataView.h
829     runtime/JSDestructibleObject.h
830     runtime/JSDestructibleObjectHeapCellType.h
831     runtime/JSExportMacros.h
832     runtime/JSFunction.h
833     runtime/JSFunctionInlines.h
834     runtime/JSGenericTypedArrayView.h
835     runtime/JSGenericTypedArrayViewInlines.h
836     runtime/JSGenericTypedArrayViewPrototype.h
837     runtime/JSGenericTypedArrayViewPrototypeInlines.h
838     runtime/JSGlobalLexicalEnvironment.h
839     runtime/JSGlobalObject.h
840     runtime/JSGlobalObjectInlines.h
841     runtime/JSImmutableButterfly.h
842     runtime/JSInternalPromise.h
843     runtime/JSInternalPromiseDeferred.h
844     runtime/JSMicrotask.h
845     runtime/JSLock.h
846     runtime/JSMap.h
847     runtime/JSMapIterator.h
848     runtime/JSModuleLoader.h
849     runtime/JSModuleRecord.h
850     runtime/JSNativeStdFunction.h
851     runtime/JSONObject.h
852     runtime/JSObject.h
853     runtime/JSObjectInlines.h
854     runtime/JSPromise.h
855     runtime/JSPromiseConstructor.h
856     runtime/JSPromiseDeferred.h
857     runtime/JSPropertyNameEnumerator.h
858     runtime/JSProxy.h
859     runtime/JSRunLoopTimer.h
860     runtime/JSScope.h
861     runtime/JSScriptFetchParameters.h
862     runtime/JSScriptFetcher.h
863     runtime/JSSegmentedVariableObject.h
864     runtime/JSSegmentedVariableObjectHeapCellType.h
865     runtime/JSSet.h
866     runtime/JSSetIterator.h
867     runtime/JSSourceCode.h
868     runtime/JSString.h
869     runtime/JSStringInlines.h
870     runtime/JSSymbolTableObject.h
871     runtime/JSType.h
872     runtime/JSTypeInfo.h
873     runtime/JSTypedArrays.h
874     runtime/JSWithScope.h
875     runtime/JSWrapperObject.h
876     runtime/LazyClassStructure.h
877     runtime/LazyProperty.h
878     runtime/Lookup.h
879     runtime/MatchResult.h
880     runtime/MathCommon.h
881     runtime/MemoryStatistics.h
882     runtime/Microtask.h
883     runtime/ModuleProgramExecutable.h
884     runtime/NativeExecutable.h
885     runtime/NativeFunction.h
886     runtime/NumberObject.h
887     runtime/NumberPrototype.h
888     runtime/NumericStrings.h
889     runtime/ObjectConstructor.h
890     runtime/ObjectInitializationScope.h
891     runtime/ObjectPrototype.h
892     runtime/Operations.h
893     runtime/Options.h
894     runtime/ParseInt.h
895     runtime/PrivateName.h
896     runtime/ProgramExecutable.h
897     runtime/PromiseDeferredTimer.h
898     runtime/PropertyDescriptor.h
899     runtime/PropertyMapHashTable.h
900     runtime/PropertyName.h
901     runtime/PropertyNameArray.h
902     runtime/PropertyOffset.h
903     runtime/PropertySlot.h
904     runtime/PropertyStorage.h
905     runtime/Protect.h
906     runtime/PrototypeKey.h
907     runtime/PureNaN.h
908     runtime/PutDirectIndexMode.h
909     runtime/PutPropertySlot.h
910     runtime/RegExp.h
911     runtime/RegExpCachedResult.h
912     runtime/RegExpGlobalData.h
913     runtime/RegExpKey.h
914     runtime/RegExpObject.h
915     runtime/RuntimeFlags.h
916     runtime/RuntimeType.h
917     runtime/SamplingProfiler.h
918     runtime/ScopeOffset.h
919     runtime/ScopedArgumentsTable.h
920     runtime/ScriptExecutable.h
921     runtime/ScriptFetchParameters.h
922     runtime/ScriptFetcher.h
923     runtime/SlowPathReturnType.h
924     runtime/SmallStrings.h
925     runtime/SourceOrigin.h
926     runtime/SparseArrayValueMap.h
927     runtime/StackAlignment.h
928     runtime/StackFrame.h
929     runtime/StringObject.h
930     runtime/StringPrototype.h
931     runtime/Structure.h
932     runtime/StructureCache.h
933     runtime/StructureChain.h
934     runtime/StructureIDBlob.h
935     runtime/StructureIDTable.h
936     runtime/StructureInlines.h
937     runtime/StructureRareData.h
938     runtime/StructureRareDataInlines.h
939     runtime/StructureTransitionTable.h
940     runtime/Symbol.h
941     runtime/SymbolPrototype.h
942     runtime/SymbolTable.h
943     runtime/TemplateObjectDescriptor.h
944     runtime/TestRunnerUtils.h
945     runtime/ThrowScope.h
946     runtime/ToNativeFromValue.h
947     runtime/TypeError.h
948     runtime/TypeSet.h
949     runtime/TypedArrayAdaptors.h
950     runtime/TypedArrayController.h
951     runtime/TypedArrayInlines.h
952     runtime/TypedArrayType.h
953     runtime/TypedArrays.h
954     runtime/TypeofType.h
955     runtime/Uint16Array.h
956     runtime/Uint32Array.h
957     runtime/Uint8Array.h
958     runtime/Uint8ClampedArray.h
959     runtime/VM.h
960     runtime/VMEntryScope.h
961     runtime/VMInlines.h
962     runtime/VMTraps.h
963     runtime/VarOffset.h
964     runtime/Watchdog.h
965     runtime/WeakGCMap.h
966     runtime/WeakGCMapInlines.h
967     runtime/WriteBarrier.h
968     runtime/WriteBarrierInlines.h
969
970     wasm/WasmCodeBlock.h
971     wasm/WasmContext.h
972     wasm/WasmEmbedder.h
973     wasm/WasmExceptionType.h
974     wasm/WasmFaultSignalHandler.h
975     wasm/WasmIndexOrName.h
976     wasm/WasmMemory.h
977     wasm/WasmMemoryMode.h
978     wasm/WasmModule.h
979     wasm/WasmName.h
980     wasm/WasmNameSection.h
981     wasm/WasmPageCount.h
982     wasm/WasmTierUpCount.h
983
984     wasm/js/JSWebAssemblyModule.h
985     wasm/js/WebAssemblyPrototype.h
986
987
988     yarr/RegularExpression.h
989     yarr/Yarr.h
990     yarr/YarrErrorCode.h
991     yarr/YarrInterpreter.h
992     yarr/YarrJIT.h
993     yarr/YarrParser.h
994     yarr/YarrPattern.h
995     yarr/YarrUnicodeProperties.h
996 )
997
998 # GENERATOR 1-B: particular LUT creator (for 1 file only)
999 GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
1000
1001 file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr)
1002
1003 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
1004 add_custom_command(
1005     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/RegExpJitTables.h
1006     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/yarr/create_regex_tables
1007     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/yarr/create_regex_tables ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/RegExpJitTables.h
1008     VERBATIM)
1009 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/RegExpJitTables.h)
1010 WEBKIT_ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/RegExpJitTables.h)
1011
1012 add_custom_command(
1013     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/UnicodePatternTables.h
1014     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/yarr/generateYarrUnicodePropertyTables.py
1015     DEPENDS ${JAVASCRIPTCORE_DIR}/yarr/hasher.py ${JAVASCRIPTCORE_DIR}/ucd/DerivedBinaryProperties.txt ${JAVASCRIPTCORE_DIR}/ucd/DerivedCoreProperties.txt ${JAVASCRIPTCORE_DIR}/ucd/DerivedNormalizationProps.txt ${JAVASCRIPTCORE_DIR}/ucd/PropList.txt ${JAVASCRIPTCORE_DIR}/ucd/PropertyAliases.txt ${JAVASCRIPTCORE_DIR}/ucd/PropertyValueAliases.txt ${JAVASCRIPTCORE_DIR}/ucd/ScriptExtensions.txt ${JAVASCRIPTCORE_DIR}/ucd/Scripts.txt ${JAVASCRIPTCORE_DIR}/ucd/UnicodeData.txt ${JAVASCRIPTCORE_DIR}/ucd/emoji-data.txt
1016     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/yarr/generateYarrUnicodePropertyTables.py ${JAVASCRIPTCORE_DIR}/ucd ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/UnicodePatternTables.h
1017     VERBATIM)
1018 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/UnicodePatternTables.h)
1019 WEBKIT_ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/UnicodePatternTables.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/UnicodePatternTables.h)
1020
1021 add_custom_command(
1022     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/YarrCanonicalizeUnicode.cpp
1023     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/yarr/generateYarrCanonicalizeUnicode
1024     DEPENDS ${JAVASCRIPTCORE_DIR}/ucd/CaseFolding.txt
1025     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/yarr/generateYarrCanonicalizeUnicode ${JAVASCRIPTCORE_DIR}/ucd/CaseFolding.txt ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/YarrCanonicalizeUnicode.cpp
1026     VERBATIM)
1027
1028 #GENERATOR: "IntlCanonicalizeLanguage.h": tables used by Intl
1029 add_custom_command(
1030     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/IntlCanonicalizeLanguage.h
1031     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/Scripts/generateIntlCanonicalizeLanguage.py
1032     DEPENDS ${JAVASCRIPTCORE_DIR}/ucd/language-subtag-registry.txt
1033     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/Scripts/generateIntlCanonicalizeLanguage.py ${JAVASCRIPTCORE_DIR}/ucd/language-subtag-registry.txt ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/IntlCanonicalizeLanguage.h
1034     VERBATIM)
1035 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/IntlCanonicalizeLanguage.h)
1036 WEBKIT_ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/runtime/IntlObject.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/IntlCanonicalizeLanguage.h)
1037
1038 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
1039 add_custom_command(
1040     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
1041     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py
1042     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table
1043     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
1044     VERBATIM)
1045 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
1046 WEBKIT_ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
1047
1048
1049 # Inspector Interfaces
1050
1051 set(JavaScriptCore_INSPECTOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
1052
1053 set(JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS
1054     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py
1055     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator.py
1056     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator_templates.py
1057     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_js_backend_commands.py
1058     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_header.py
1059     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_implementation.py
1060     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_header.py
1061     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_implementation.py
1062     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_header.py
1063     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_implementation.py
1064     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator.py
1065     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator_templates.py
1066     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/__init__.py
1067     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/models.py
1068 )
1069
1070 set(JavaScriptCore_INSPECTOR_DOMAINS
1071     ${JAVASCRIPTCORE_DIR}/inspector/protocol/ApplicationCache.json
1072     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Audit.json
1073     ${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json
1074     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Canvas.json
1075     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json
1076     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOM.json
1077     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMDebugger.json
1078     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMStorage.json
1079     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Database.json
1080     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Debugger.json
1081     ${JAVASCRIPTCORE_DIR}/inspector/protocol/GenericTypes.json
1082     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Heap.json
1083     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Inspector.json
1084     ${JAVASCRIPTCORE_DIR}/inspector/protocol/LayerTree.json
1085     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Network.json
1086     ${JAVASCRIPTCORE_DIR}/inspector/protocol/OverlayTypes.json
1087     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Page.json
1088     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Recording.json
1089     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Runtime.json
1090     ${JAVASCRIPTCORE_DIR}/inspector/protocol/ScriptProfiler.json
1091     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Security.json
1092     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Target.json
1093     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Timeline.json
1094     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Worker.json
1095 )
1096
1097 if (ENABLE_INDEXED_DATABASE)
1098     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1099         ${JAVASCRIPTCORE_DIR}/inspector/protocol/IndexedDB.json
1100     )
1101 endif ()
1102
1103 if (ENABLE_RESOURCE_USAGE)
1104     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1105         ${JAVASCRIPTCORE_DIR}/inspector/protocol/CPUProfiler.json
1106         ${JAVASCRIPTCORE_DIR}/inspector/protocol/Memory.json
1107     )
1108 endif ()
1109
1110 if (ENABLE_SERVICE_WORKER)
1111     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1112         ${JAVASCRIPTCORE_DIR}/inspector/protocol/ServiceWorker.json
1113     )
1114 endif ()
1115
1116 add_custom_command(
1117     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1118     MAIN_DEPENDENCY ${JavaScriptCore_SCRIPTS_DIR}/generate-combined-inspector-json.py
1119     DEPENDS ${JavaScriptCore_INSPECTOR_DOMAINS}
1120     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/generate-combined-inspector-json.py ${JavaScriptCore_INSPECTOR_DOMAINS} > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1121     VERBATIM)
1122
1123 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
1124 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol)
1125 file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
1126 add_custom_command(
1127     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.cpp
1128            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
1129            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.cpp
1130            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
1131            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.cpp
1132            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
1133            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
1134     MAIN_DEPENDENCY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1135     DEPENDS ${JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS}
1136     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py --outputDir "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector" --framework JavaScriptCore ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1137     VERBATIM)
1138
1139 # JSCBuiltins
1140
1141 set(BUILTINS_GENERATOR_SCRIPTS
1142     ${JavaScriptCore_SCRIPTS_DIR}/wkbuiltins.py
1143     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generator.py
1144     ${JavaScriptCore_SCRIPTS_DIR}/builtins_model.py
1145     ${JavaScriptCore_SCRIPTS_DIR}/builtins_templates.py
1146     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_combined_header.py
1147     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_combined_implementation.py
1148     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_separate_header.py
1149     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_separate_implementation.py
1150     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_wrapper_header.py
1151     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_wrapper_implementation.py
1152     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_internals_wrapper_header.py
1153     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_internals_wrapper_implementation.py
1154     ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
1155     ${JavaScriptCore_SCRIPTS_DIR}/lazywriter.py
1156 )
1157
1158 set(JavaScriptCore_BUILTINS_SOURCES
1159     ${JAVASCRIPTCORE_DIR}/builtins/AsyncFromSyncIteratorPrototype.js
1160     ${JAVASCRIPTCORE_DIR}/builtins/ArrayConstructor.js
1161     ${JAVASCRIPTCORE_DIR}/builtins/ArrayIteratorPrototype.js
1162     ${JAVASCRIPTCORE_DIR}/builtins/ArrayPrototype.js
1163     ${JAVASCRIPTCORE_DIR}/builtins/AsyncFunctionPrototype.js
1164     ${JAVASCRIPTCORE_DIR}/builtins/AsyncIteratorPrototype.js
1165     ${JAVASCRIPTCORE_DIR}/builtins/AsyncGeneratorPrototype.js
1166     ${JAVASCRIPTCORE_DIR}/builtins/DatePrototype.js
1167     ${JAVASCRIPTCORE_DIR}/builtins/FunctionPrototype.js
1168     ${JAVASCRIPTCORE_DIR}/builtins/GeneratorPrototype.js
1169     ${JAVASCRIPTCORE_DIR}/builtins/GlobalObject.js
1170     ${JAVASCRIPTCORE_DIR}/builtins/GlobalOperations.js
1171     ${JAVASCRIPTCORE_DIR}/builtins/InspectorInstrumentationObject.js
1172     ${JAVASCRIPTCORE_DIR}/builtins/InternalPromiseConstructor.js
1173     ${JAVASCRIPTCORE_DIR}/builtins/IteratorHelpers.js
1174     ${JAVASCRIPTCORE_DIR}/builtins/IteratorPrototype.js
1175     ${JAVASCRIPTCORE_DIR}/builtins/MapIteratorPrototype.js
1176     ${JAVASCRIPTCORE_DIR}/builtins/MapPrototype.js
1177     ${JAVASCRIPTCORE_DIR}/builtins/ModuleLoader.js
1178     ${JAVASCRIPTCORE_DIR}/builtins/NumberConstructor.js
1179     ${JAVASCRIPTCORE_DIR}/builtins/NumberPrototype.js
1180     ${JAVASCRIPTCORE_DIR}/builtins/ObjectConstructor.js
1181     ${JAVASCRIPTCORE_DIR}/builtins/PromiseConstructor.js
1182     ${JAVASCRIPTCORE_DIR}/builtins/PromiseOperations.js
1183     ${JAVASCRIPTCORE_DIR}/builtins/PromisePrototype.js
1184     ${JAVASCRIPTCORE_DIR}/builtins/ReflectObject.js
1185     ${JAVASCRIPTCORE_DIR}/builtins/RegExpPrototype.js
1186     ${JAVASCRIPTCORE_DIR}/builtins/SetIteratorPrototype.js
1187     ${JAVASCRIPTCORE_DIR}/builtins/SetPrototype.js
1188     ${JAVASCRIPTCORE_DIR}/builtins/StringConstructor.js
1189     ${JAVASCRIPTCORE_DIR}/builtins/StringIteratorPrototype.js
1190     ${JAVASCRIPTCORE_DIR}/builtins/StringPrototype.js
1191     ${JAVASCRIPTCORE_DIR}/builtins/TypedArrayConstructor.js
1192     ${JAVASCRIPTCORE_DIR}/builtins/TypedArrayPrototype.js
1193     ${JAVASCRIPTCORE_DIR}/builtins/WebAssemblyPrototype.js
1194 )
1195
1196 add_custom_command(
1197     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1198     MAIN_DEPENDENCY ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
1199     DEPENDS ${JavaScriptCore_BUILTINS_SOURCES} ${BUILTINS_GENERATOR_SCRIPTS}
1200     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py --framework JavaScriptCore --output-directory ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} --combined ${JavaScriptCore_BUILTINS_SOURCES}
1201     VERBATIM)
1202
1203 list(APPEND JavaScriptCore_HEADERS
1204     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
1205     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
1206     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
1207     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1208 )
1209
1210 add_custom_command(
1211     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcode.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcodeGenerated.h
1212     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/b3/air/AirOpcode.opcodes
1213     DEPENDS ${JAVASCRIPTCORE_DIR}/b3/air/opcode_generator.rb
1214     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/b3/air/opcode_generator.rb ${JAVASCRIPTCORE_DIR}/b3/air/AirOpcode.opcodes VERBATIM
1215     WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
1216 )
1217
1218 list(APPEND JavaScriptCore_HEADERS
1219     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcode.h
1220     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcodeGenerated.h
1221 )
1222
1223 add_custom_command(
1224     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1225     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js
1226     DEPENDS ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
1227     COMMAND ${CMAKE_COMMAND} -E echo "//# sourceURL=__InjectedScript_InjectedScriptSource.js" > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1228     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py < ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js >> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1229     COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl InjectedScriptSource_js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h
1230     VERBATIM)
1231
1232 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h)
1233
1234 if (WTF_CPU_X86_64)
1235     if (MSVC AND NOT ENABLE_C_LOOP)
1236         add_custom_command(
1237             OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj
1238             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1239             COMMAND ml64 -nologo -c -Fo ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1240             VERBATIM)
1241
1242         list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj)
1243     endif ()
1244 endif ()
1245
1246 WEBKIT_FRAMEWORK_DECLARE(JavaScriptCore)
1247 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
1248
1249 if (COMPILER_IS_GCC_OR_CLANG)
1250     # Avoid using fused multiply-add instructions since this could give different results
1251     # for e.g. parseInt depending on the platform and compilation flags.
1252     WEBKIT_ADD_TARGET_CXX_FLAGS(JavaScriptCore -ffp-contract=off)
1253
1254     # Avoid "variable tracking size limit exceeded"
1255     set_source_files_properties(builtins/BuiltinNames.cpp PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments)
1256 endif ()
1257
1258 WEBKIT_MAKE_FORWARDING_HEADERS(JavaScriptCore
1259     FILES ${JavaScriptCore_PUBLIC_FRAMEWORK_HEADERS}
1260     FLATTENED
1261 )
1262
1263 WEBKIT_MAKE_FORWARDING_HEADERS(JavaScriptCore
1264     TARGET_NAME JavaScriptCorePrivateForwardingHeaders
1265     FILES ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS}
1266     DERIVED_SOURCE_DIRECTORIES ${DERIVED_SOURCES_DIR}/JavaScriptCore ${DERIVED_SOURCES_DIR}/JavaScriptCore/inspector
1267     FLATTENED
1268 )
1269
1270 target_include_directories(LLIntSettingsExtractor PRIVATE
1271     ${JavaScriptCore_INCLUDE_DIRECTORIES}
1272     ${JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES}
1273 )
1274 target_include_directories(LLIntSettingsExtractor SYSTEM PRIVATE ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
1275
1276 target_include_directories(LLIntOffsetsExtractor PRIVATE
1277     ${JavaScriptCore_INCLUDE_DIRECTORIES}
1278     ${JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES}
1279 )
1280 target_include_directories(LLIntOffsetsExtractor SYSTEM PRIVATE ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
1281
1282 add_subdirectory(shell)
1283
1284 WEBKIT_COMPUTE_SOURCES(JavaScriptCore)
1285 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
1286 WEBKIT_FRAMEWORK(JavaScriptCore)
1287
1288 if (NOT "${PORT}" STREQUAL "Mac")
1289     if (${JavaScriptCore_LIBRARY_TYPE} STREQUAL "SHARED")
1290         WEBKIT_POPULATE_LIBRARY_VERSION(JAVASCRIPTCORE)
1291         set_target_properties(JavaScriptCore PROPERTIES VERSION ${JAVASCRIPTCORE_VERSION} SOVERSION ${JAVASCRIPTCORE_VERSION_MAJOR})
1292         install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}")
1293     endif ()
1294 endif ()
1295
1296 # Force staging of shared scripts, even if they aren't directly used to build JavaScriptCore.
1297
1298 add_custom_target(stageSharedScripts DEPENDS ${JavaScriptCore_SCRIPTS})
1299 add_dependencies(JavaScriptCore stageSharedScripts ${JavaScriptCore_EXTRA_DEPENDENCIES})
1300
1301 if (MSVC)
1302     add_custom_command(
1303         TARGET JavaScriptCore
1304         PRE_BUILD
1305         COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/auto-version.pl ${DERIVED_SOURCES_DIR}
1306         VERBATIM)
1307
1308     add_custom_command(
1309         TARGET JavaScriptCore
1310         POST_BUILD
1311         COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/version-stamp.pl ${DERIVED_SOURCES_DIR} $<TARGET_FILE:JavaScriptCore>
1312         VERBATIM)
1313 endif ()