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