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