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