Generate header detection headers for CMake on Windows.
[WebKit-https.git] / Source / JavaScriptCore / CMakeLists.txt
1 set(JavaScriptCore_INCLUDE_DIRECTORIES
2     "${CMAKE_BINARY_DIR}"
3     "${JAVASCRIPTCORE_DIR}"
4     "${JAVASCRIPTCORE_DIR}/API"
5     "${JAVASCRIPTCORE_DIR}/ForwardingHeaders"
6     "${JAVASCRIPTCORE_DIR}/assembler"
7     "${JAVASCRIPTCORE_DIR}/bindings"
8     "${JAVASCRIPTCORE_DIR}/builtins"
9     "${JAVASCRIPTCORE_DIR}/bytecode"
10     "${JAVASCRIPTCORE_DIR}/bytecompiler"
11     "${JAVASCRIPTCORE_DIR}/dfg"
12     "${JAVASCRIPTCORE_DIR}/disassembler"
13     "${JAVASCRIPTCORE_DIR}/ftl"
14     "${JAVASCRIPTCORE_DIR}/heap"
15     "${JAVASCRIPTCORE_DIR}/debugger"
16     "${JAVASCRIPTCORE_DIR}/inspector"
17     "${JAVASCRIPTCORE_DIR}/inspector/agents"
18     "${JAVASCRIPTCORE_DIR}/inspector/remote"
19     "${JAVASCRIPTCORE_DIR}/interpreter"
20     "${JAVASCRIPTCORE_DIR}/jit"
21     "${JAVASCRIPTCORE_DIR}/llint"
22     "${JAVASCRIPTCORE_DIR}/llvm"
23     "${JAVASCRIPTCORE_DIR}/parser"
24     "${JAVASCRIPTCORE_DIR}/profiler"
25     "${JAVASCRIPTCORE_DIR}/replay"
26     "${JAVASCRIPTCORE_DIR}/runtime"
27     "${JAVASCRIPTCORE_DIR}/tools"
28     "${JAVASCRIPTCORE_DIR}/yarr"
29     "${WTF_DIR}"
30     "${DERIVED_SOURCES_DIR}"
31     "${DERIVED_SOURCES_DIR}/ForwardingHeaders"
32     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
33     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector"
34     "${CMAKE_SOURCE_DIR}/Source"
35     ${ICU_INCLUDE_DIRS}
36 )
37
38 set(JavaScriptCore_SOURCES
39     API/JSBase.cpp
40     API/JSCTestRunnerUtils.cpp
41     API/JSCallbackConstructor.cpp
42     API/JSCallbackFunction.cpp
43     API/JSCallbackObject.cpp
44     API/JSClassRef.cpp
45     API/JSContextRef.cpp
46     API/JSObjectRef.cpp
47     API/JSProfilerPrivate.cpp
48     API/JSScriptRef.cpp
49     API/JSStringRef.cpp
50     API/JSValueRef.cpp
51     API/JSWeakObjectMapRefPrivate.cpp
52     API/OpaqueJSString.cpp
53
54     assembler/LinkBuffer.cpp
55     assembler/MacroAssembler.cpp
56     assembler/MacroAssemblerX86Common.cpp
57
58     bindings/ScriptFunctionCall.cpp
59     bindings/ScriptObject.cpp
60     bindings/ScriptValue.cpp
61
62     builtins/BuiltinExecutables.cpp
63
64     bytecode/ArrayAllocationProfile.cpp
65     bytecode/ArrayProfile.cpp
66     bytecode/BytecodeBasicBlock.cpp
67     bytecode/BytecodeLivenessAnalysis.cpp
68     bytecode/CallLinkInfo.cpp
69     bytecode/CallLinkStatus.cpp
70     bytecode/CodeBlock.cpp
71     bytecode/CodeBlockHash.cpp
72     bytecode/CodeBlockJettisoningWatchpoint.cpp
73     bytecode/CodeOrigin.cpp
74     bytecode/CodeType.cpp
75     bytecode/ComplexGetStatus.cpp
76     bytecode/ConstantStructureCheck.cpp
77     bytecode/DFGExitProfile.cpp
78     bytecode/DeferredCompilationCallback.cpp
79     bytecode/ExecutionCounter.cpp
80     bytecode/ExitKind.cpp
81     bytecode/ExitingJITType.cpp
82     bytecode/GetByIdStatus.cpp
83     bytecode/GetByIdVariant.cpp
84     bytecode/InlineCallFrameSet.cpp
85     bytecode/JumpTable.cpp
86     bytecode/LazyOperandValueProfile.cpp
87     bytecode/MethodOfGettingAValueProfile.cpp
88     bytecode/Opcode.cpp
89     bytecode/PolymorphicGetByIdList.cpp
90     bytecode/PolymorphicPutByIdList.cpp
91     bytecode/PreciseJumpTargets.cpp
92     bytecode/PutByIdStatus.cpp
93     bytecode/PutByIdVariant.cpp
94     bytecode/ReduceWhitespace.cpp
95     bytecode/SamplingTool.cpp
96     bytecode/SpecialPointer.cpp
97     bytecode/SpeculatedType.cpp
98     bytecode/StructureSet.cpp
99     bytecode/StructureStubClearingWatchpoint.cpp
100     bytecode/StructureStubInfo.cpp
101     bytecode/ToThisStatus.cpp
102     bytecode/UnlinkedCodeBlock.cpp
103     bytecode/UnlinkedInstructionStream.cpp
104     bytecode/ValueRecovery.cpp
105     bytecode/VariableWatchpointSet.cpp
106     bytecode/Watchpoint.cpp
107
108     bytecompiler/BytecodeGenerator.cpp
109     bytecompiler/NodesCodegen.cpp
110
111     debugger/Debugger.cpp
112     debugger/DebuggerCallFrame.cpp
113     debugger/DebuggerScope.cpp
114
115     dfg/DFGAbstractHeap.cpp
116     dfg/DFGAbstractValue.cpp
117     dfg/DFGArgumentsSimplificationPhase.cpp
118     dfg/DFGArithMode.cpp
119     dfg/DFGArrayMode.cpp
120     dfg/DFGAtTailAbstractState.cpp
121     dfg/DFGAvailability.cpp
122     dfg/DFGBackwardsPropagationPhase.cpp
123     dfg/DFGBasicBlock.cpp
124     dfg/DFGBinarySwitch.cpp
125     dfg/DFGBlockInsertionSet.cpp
126     dfg/DFGByteCodeParser.cpp
127     dfg/DFGCFAPhase.cpp
128     dfg/DFGCFGSimplificationPhase.cpp
129     dfg/DFGCPSRethreadingPhase.cpp
130     dfg/DFGCSEPhase.cpp
131     dfg/DFGCapabilities.cpp
132     dfg/DFGClobberSet.cpp
133     dfg/DFGClobberize.cpp
134     dfg/DFGCommon.cpp
135     dfg/DFGCommonData.cpp
136     dfg/DFGCompilationKey.cpp
137     dfg/DFGCompilationMode.cpp
138     dfg/DFGConstantFoldingPhase.cpp
139     dfg/DFGCriticalEdgeBreakingPhase.cpp
140     dfg/DFGDCEPhase.cpp
141     dfg/DFGDesiredIdentifiers.cpp
142     dfg/DFGDesiredTransitions.cpp
143     dfg/DFGDesiredWatchpoints.cpp
144     dfg/DFGDesiredWeakReferences.cpp
145     dfg/DFGDesiredWriteBarriers.cpp
146     dfg/DFGDisassembler.cpp
147     dfg/DFGDoesGC.cpp
148     dfg/DFGDominators.cpp
149     dfg/DFGDriver.cpp
150     dfg/DFGEdge.cpp
151     dfg/DFGFailedFinalizer.cpp
152     dfg/DFGFinalizer.cpp
153     dfg/DFGFixupPhase.cpp
154     dfg/DFGFlushFormat.cpp
155     dfg/DFGFlushedAt.cpp
156     dfg/DFGFrozenValue.cpp
157     dfg/DFGFunctionWhitelist.cpp
158     dfg/DFGGraph.cpp
159     dfg/DFGGraphSafepoint.cpp
160     dfg/DFGHeapLocation.cpp
161     dfg/DFGInPlaceAbstractState.cpp
162     dfg/DFGIntegerCheckCombiningPhase.cpp
163     dfg/DFGInvalidationPointInjectionPhase.cpp
164     dfg/DFGJITCode.cpp
165     dfg/DFGJITCompiler.cpp
166     dfg/DFGJITFinalizer.cpp
167     dfg/DFGJumpReplacement.cpp
168     dfg/DFGLICMPhase.cpp
169     dfg/DFGLazyJSValue.cpp
170     dfg/DFGLivenessAnalysisPhase.cpp
171     dfg/DFGLongLivedState.cpp
172     dfg/DFGLoopPreHeaderCreationPhase.cpp
173     dfg/DFGMayExit.cpp
174     dfg/DFGMinifiedNode.cpp
175     dfg/DFGNaturalLoops.cpp
176     dfg/DFGNode.cpp
177     dfg/DFGNodeFlags.cpp
178     dfg/DFGOSRAvailabilityAnalysisPhase.cpp
179     dfg/DFGOSREntry.cpp
180     dfg/DFGOSREntrypointCreationPhase.cpp
181     dfg/DFGOSRExit.cpp
182     dfg/DFGOSRExitBase.cpp
183     dfg/DFGOSRExitCompiler.cpp
184     dfg/DFGOSRExitCompiler32_64.cpp
185     dfg/DFGOSRExitCompiler64.cpp
186     dfg/DFGOSRExitCompilerCommon.cpp
187     dfg/DFGOSRExitJumpPlaceholder.cpp
188     dfg/DFGOSRExitPreparation.cpp
189     dfg/DFGOperations.cpp
190     dfg/DFGPhantomCanonicalizationPhase.cpp
191     dfg/DFGPhantomRemovalPhase.cpp
192     dfg/DFGPhase.cpp
193     dfg/DFGPlan.cpp
194     dfg/DFGPredictionInjectionPhase.cpp
195     dfg/DFGPredictionPropagationPhase.cpp
196     dfg/DFGPureValue.cpp
197     dfg/DFGResurrectionForValidationPhase.cpp
198     dfg/DFGSSAConversionPhase.cpp
199     dfg/DFGSSALoweringPhase.cpp
200     dfg/DFGSafepoint.cpp
201     dfg/DFGSpeculativeJIT.cpp
202     dfg/DFGSpeculativeJIT32_64.cpp
203     dfg/DFGSpeculativeJIT64.cpp
204     dfg/DFGStackLayoutPhase.cpp
205     dfg/DFGStaticExecutionCountEstimationPhase.cpp
206     dfg/DFGStoreBarrierElisionPhase.cpp
207     dfg/DFGStrengthReductionPhase.cpp
208     dfg/DFGStructureAbstractValue.cpp
209     dfg/DFGThreadData.cpp
210     dfg/DFGThunks.cpp
211     dfg/DFGTierUpCheckInjectionPhase.cpp
212     dfg/DFGTransition.cpp
213     dfg/DFGTypeCheckHoistingPhase.cpp
214     dfg/DFGUnificationPhase.cpp
215     dfg/DFGUseKind.cpp
216     dfg/DFGValidate.cpp
217     dfg/DFGValueSource.cpp
218     dfg/DFGValueStrength.cpp
219     dfg/DFGVariableAccessData.cpp
220     dfg/DFGVariableAccessDataDump.cpp
221     dfg/DFGVariableEvent.cpp
222     dfg/DFGVariableEventStream.cpp
223     dfg/DFGVirtualRegisterAllocationPhase.cpp
224     dfg/DFGWatchableStructureWatchingPhase.cpp
225     dfg/DFGWatchpointCollectionPhase.cpp
226     dfg/DFGWorklist.cpp
227
228     disassembler/ARMv7/ARMv7DOpcode.cpp
229     disassembler/ARMv7Disassembler.cpp
230     disassembler/Disassembler.cpp
231     disassembler/LLVMDisassembler.cpp
232     disassembler/X86Disassembler.cpp
233
234     heap/BlockAllocator.cpp
235     heap/CodeBlockSet.cpp
236     heap/ConservativeRoots.cpp
237     heap/CopiedSpace.cpp
238     heap/CopyVisitor.cpp
239     heap/DeferGC.cpp
240     heap/EdenGCActivityCallback.cpp
241     heap/FullGCActivityCallback.cpp
242     heap/GCActivityCallback.cpp
243     heap/GCLogging.cpp
244     heap/GCThread.cpp
245     heap/GCThreadSharedData.cpp
246     heap/HandleSet.cpp
247     heap/HandleStack.cpp
248     heap/Heap.cpp
249     heap/HeapStatistics.cpp
250     heap/HeapTimer.cpp
251     heap/IncrementalSweeper.cpp
252     heap/JITStubRoutineSet.cpp
253     heap/MachineStackMarker.cpp
254     heap/MarkStack.cpp
255     heap/MarkedAllocator.cpp
256     heap/MarkedBlock.cpp
257     heap/MarkedSpace.cpp
258     heap/SlotVisitor.cpp
259     heap/SuperRegion.cpp
260     heap/Weak.cpp
261     heap/WeakBlock.cpp
262     heap/WeakHandleOwner.cpp
263     heap/WeakSet.cpp
264     heap/WriteBarrierBuffer.cpp
265     heap/WriteBarrierSupport.cpp
266
267     inspector/ConsoleMessage.cpp
268     inspector/ContentSearchUtilities.cpp
269     inspector/EventLoop.cpp
270     inspector/IdentifiersFactory.cpp
271     inspector/InjectedScript.cpp
272     inspector/InjectedScriptBase.cpp
273     inspector/InjectedScriptHost.cpp
274     inspector/InjectedScriptManager.cpp
275     inspector/InjectedScriptModule.cpp
276     inspector/InspectorAgentRegistry.cpp
277     inspector/InspectorBackendDispatcher.cpp
278     inspector/InspectorValues.cpp
279     inspector/JSConsoleClient.cpp
280     inspector/JSInjectedScriptHost.cpp
281     inspector/JSInjectedScriptHostPrototype.cpp
282     inspector/JSGlobalObjectInspectorController.cpp
283     inspector/JSGlobalObjectScriptDebugServer.cpp
284     inspector/JSJavaScriptCallFrame.cpp
285     inspector/JSJavaScriptCallFramePrototype.cpp
286     inspector/JavaScriptCallFrame.cpp
287     inspector/ScriptArguments.cpp
288     inspector/ScriptCallFrame.cpp
289     inspector/ScriptCallStack.cpp
290     inspector/ScriptCallStackFactory.cpp
291     inspector/ScriptDebugServer.cpp
292
293     inspector/agents/InspectorAgent.cpp
294     inspector/agents/InspectorConsoleAgent.cpp
295     inspector/agents/InspectorDebuggerAgent.cpp
296     inspector/agents/InspectorProfilerAgent.cpp
297     inspector/agents/InspectorRuntimeAgent.cpp
298     inspector/agents/JSGlobalObjectConsoleAgent.cpp
299     inspector/agents/JSGlobalObjectDebuggerAgent.cpp
300     inspector/agents/JSGlobalObjectProfilerAgent.cpp
301     inspector/agents/JSGlobalObjectRuntimeAgent.cpp
302
303     interpreter/AbstractPC.cpp
304     interpreter/CallFrame.cpp
305     interpreter/Interpreter.cpp
306     interpreter/JSStack.cpp
307     interpreter/ProtoCallFrame.cpp
308     interpreter/StackVisitor.cpp
309     interpreter/VMInspector.cpp
310
311     jit/AccessorCallJITStubRoutine.cpp
312     jit/AssemblyHelpers.cpp
313     jit/ArityCheckFailReturnThunks.cpp
314     jit/ClosureCallStubRoutine.cpp
315     jit/ExecutableAllocator.cpp
316     jit/ExecutableAllocatorFixedVMPool.cpp
317     jit/GCAwareJITStubRoutine.cpp
318     jit/HostCallReturnValue.cpp
319     jit/JIT.cpp
320     jit/JITArithmetic.cpp
321     jit/JITArithmetic32_64.cpp
322     jit/JITCall.cpp
323     jit/JITCall32_64.cpp
324     jit/JITCode.cpp
325     jit/JITDisassembler.cpp
326     jit/JITExceptions.cpp
327     jit/JITInlineCacheGenerator.cpp
328     jit/JITOpcodes.cpp
329     jit/JITOpcodes32_64.cpp
330     jit/JITOperations.cpp
331     jit/JITPropertyAccess.cpp
332     jit/JITPropertyAccess32_64.cpp
333     jit/JITStubRoutine.cpp
334     jit/JITStubs.cpp
335     jit/JITThunks.cpp
336     jit/JITToDFGDeferredCompilationCallback.cpp
337     jit/Reg.cpp
338     jit/RegisterPreservationWrapperGenerator.cpp
339     jit/RegisterSet.cpp
340     jit/Repatch.cpp
341     jit/ScratchRegisterAllocator.cpp
342     jit/TempRegisterSet.cpp
343     jit/ThunkGenerators.cpp
344
345     parser/Lexer.cpp
346     parser/Nodes.cpp
347     parser/Parser.cpp
348     parser/ParserArena.cpp
349     parser/SourceCode.cpp
350     parser/SourceProvider.cpp
351     parser/SourceProviderCache.cpp
352
353     profiler/LegacyProfiler.cpp
354     profiler/Profile.cpp
355     profiler/ProfileGenerator.cpp
356     profiler/ProfileNode.cpp
357     profiler/ProfilerBytecode.cpp
358     profiler/ProfilerBytecodeSequence.cpp
359     profiler/ProfilerBytecodes.cpp
360     profiler/ProfilerCompilation.cpp
361     profiler/ProfilerCompilationKind.cpp
362     profiler/ProfilerCompiledBytecode.cpp
363     profiler/ProfilerDatabase.cpp
364     profiler/ProfilerJettisonReason.cpp
365     profiler/ProfilerOSRExit.cpp
366     profiler/ProfilerOSRExitSite.cpp
367     profiler/ProfilerOrigin.cpp
368     profiler/ProfilerOriginStack.cpp
369     profiler/ProfilerProfiledBytecodes.cpp
370
371     runtime/ArgList.cpp
372     runtime/Arguments.cpp
373     runtime/ArgumentsIteratorConstructor.cpp
374     runtime/ArgumentsIteratorPrototype.cpp
375     runtime/ArrayBuffer.cpp
376     runtime/ArrayBufferNeuteringWatchpoint.cpp
377     runtime/ArrayBufferView.cpp
378     runtime/ArrayConstructor.cpp
379     runtime/ArrayIteratorConstructor.cpp
380     runtime/ArrayIteratorPrototype.cpp
381     runtime/ArrayPrototype.cpp
382     runtime/BooleanConstructor.cpp
383     runtime/BooleanObject.cpp
384     runtime/BooleanPrototype.cpp
385     runtime/CallData.cpp
386     runtime/CodeCache.cpp
387     runtime/CodeSpecializationKind.cpp
388     runtime/CommonIdentifiers.cpp
389     runtime/CommonSlowPaths.cpp
390     runtime/CommonSlowPathsExceptions.cpp
391     runtime/CompilationResult.cpp
392     runtime/Completion.cpp
393     runtime/ConsoleClient.cpp
394     runtime/ConsolePrototype.cpp
395     runtime/ConstructData.cpp
396     runtime/CustomGetterSetter.cpp
397     runtime/DataView.cpp
398     runtime/DataView.h
399     runtime/DateConstructor.cpp
400     runtime/DateConversion.cpp
401     runtime/DateInstance.cpp
402     runtime/DatePrototype.cpp
403     runtime/DumpContext.cpp
404     runtime/Error.cpp
405     runtime/ErrorConstructor.cpp
406     runtime/ErrorHandlingScope.cpp
407     runtime/ErrorInstance.cpp
408     runtime/ErrorPrototype.cpp
409     runtime/ExceptionFuzz.cpp
410     runtime/ExceptionHelpers.cpp 
411     runtime/Executable.cpp
412     runtime/FunctionConstructor.cpp
413     runtime/FunctionExecutableDump.cpp
414     runtime/FunctionHasExecutedCache.cpp
415     runtime/FunctionPrototype.cpp
416     runtime/GetterSetter.cpp
417     runtime/HighFidelityLog.cpp
418     runtime/HighFidelityTypeProfiler.cpp
419     runtime/Identifier.cpp
420     runtime/IndexingType.cpp
421     runtime/InitializeThreading.cpp
422     runtime/IntendedStructureChain.cpp
423     runtime/InternalFunction.cpp
424     runtime/JSAPIValueWrapper.cpp
425     runtime/JSActivation.cpp
426     runtime/JSArgumentsIterator.cpp
427     runtime/JSArray.cpp
428     runtime/JSArrayBuffer.cpp
429     runtime/JSArrayBufferConstructor.cpp
430     runtime/JSArrayBufferPrototype.cpp
431     runtime/JSArrayBufferView.cpp
432     runtime/JSArrayIterator.cpp
433     runtime/JSBoundFunction.cpp
434     runtime/JSGlobalObjectDebuggable.cpp
435     runtime/JSCJSValue.cpp
436     runtime/JSCell.cpp
437     runtime/JSConsole.cpp
438     runtime/JSDataView.cpp
439     runtime/JSDataViewPrototype.cpp
440     runtime/JSDateMath.cpp
441     runtime/JSFunction.cpp
442     runtime/JSGlobalObject.cpp
443     runtime/JSGlobalObjectFunctions.cpp
444     runtime/JSLock.cpp
445     runtime/JSMap.cpp
446     runtime/JSMapIterator.cpp
447     runtime/JSNameScope.cpp
448     runtime/JSNotAnObject.cpp
449     runtime/JSONObject.cpp
450     runtime/JSObject.cpp
451     runtime/JSPromise.cpp
452     runtime/JSPromiseConstructor.cpp
453     runtime/JSPromiseDeferred.cpp
454     runtime/JSPromiseFunctions.cpp
455     runtime/JSPromiseReaction.cpp
456     runtime/JSPromisePrototype.cpp
457     runtime/JSProxy.cpp
458     runtime/JSPropertyNameEnumerator.cpp
459     runtime/JSScope.cpp
460     runtime/JSSegmentedVariableObject.cpp
461     runtime/JSSet.cpp
462     runtime/JSSetIterator.cpp
463     runtime/JSString.cpp
464     runtime/JSStringJoiner.cpp
465     runtime/JSSymbolTableObject.cpp
466     runtime/JSTypedArrayConstructors.cpp
467     runtime/JSTypedArrayPrototypes.cpp
468     runtime/JSTypedArrays.cpp
469     runtime/JSVariableObject.cpp
470     runtime/JSWeakMap.cpp
471     runtime/JSWithScope.cpp
472     runtime/JSWrapperObject.cpp
473     runtime/LiteralParser.cpp
474     runtime/Lookup.cpp
475     runtime/MapConstructor.cpp
476     runtime/MapData.cpp
477     runtime/MapIteratorConstructor.cpp
478     runtime/MapIteratorPrototype.cpp
479     runtime/MapPrototype.cpp
480     runtime/MathObject.cpp
481     runtime/MemoryStatistics.cpp
482     runtime/NameConstructor.cpp
483     runtime/NameInstance.cpp
484     runtime/NamePrototype.cpp
485     runtime/NativeErrorConstructor.cpp
486     runtime/NativeErrorPrototype.cpp
487     runtime/NumberConstructor.cpp
488     runtime/NumberObject.cpp
489     runtime/NumberPrototype.cpp
490     runtime/ObjectConstructor.cpp
491     runtime/ObjectPrototype.cpp
492     runtime/Operations.cpp
493     runtime/Options.cpp
494     runtime/PropertyDescriptor.cpp
495     runtime/PropertyNameArray.cpp
496     runtime/PropertySlot.cpp
497     runtime/PropertyTable.cpp
498     runtime/PrototypeMap.cpp
499     runtime/RegExp.cpp
500     runtime/RegExpCache.cpp
501     runtime/RegExpCachedResult.cpp
502     runtime/RegExpConstructor.cpp
503     runtime/RegExpMatchesArray.cpp
504     runtime/RegExpObject.cpp
505     runtime/RegExpPrototype.cpp
506     runtime/SamplingCounter.cpp
507     runtime/SetConstructor.cpp
508     runtime/SetIteratorConstructor.cpp
509     runtime/SetIteratorPrototype.cpp
510     runtime/SetPrototype.cpp
511     runtime/SimpleTypedArrayController.cpp
512     runtime/SmallStrings.cpp
513     runtime/SparseArrayValueMap.cpp
514     runtime/StrictEvalActivation.cpp
515     runtime/StringConstructor.cpp
516     runtime/StringObject.cpp
517     runtime/StringPrototype.cpp
518     runtime/StringRecursionChecker.cpp
519     runtime/Structure.cpp
520     runtime/StructureChain.cpp
521     runtime/StructureIDTable.cpp
522     runtime/StructureRareData.cpp
523     runtime/SymbolTable.cpp
524     runtime/TestRunnerUtils.cpp
525     runtime/TypeLocationCache.cpp
526     runtime/TypeSet.cpp
527     runtime/TypedArrayController.cpp
528     runtime/TypedArrayType.cpp
529     runtime/VM.cpp
530     runtime/VMEntryScope.cpp
531     runtime/Watchdog.cpp
532     runtime/WatchdogNone.cpp
533     runtime/WeakMapConstructor.cpp
534     runtime/WeakMapData.cpp
535     runtime/WeakMapPrototype.cpp
536
537     tools/CodeProfile.cpp
538     tools/CodeProfiling.cpp
539
540     yarr/RegularExpression.cpp
541     yarr/YarrCanonicalizeUCS2.cpp
542     yarr/YarrInterpreter.cpp
543     yarr/YarrJIT.cpp
544     yarr/YarrPattern.cpp
545     yarr/YarrSyntaxChecker.cpp
546 )
547
548 set(JavaScriptCore_LUT_FILES
549     runtime/ArrayConstructor.cpp
550     runtime/ArrayPrototype.cpp
551     runtime/BooleanPrototype.cpp
552     runtime/DateConstructor.cpp
553     runtime/DatePrototype.cpp
554     runtime/ErrorPrototype.cpp
555     runtime/JSDataViewPrototype.cpp
556     runtime/JSGlobalObject.cpp
557     runtime/JSONObject.cpp
558     runtime/JSPromiseConstructor.cpp
559     runtime/JSPromisePrototype.cpp
560     runtime/NamePrototype.cpp
561     runtime/NumberConstructor.cpp
562     runtime/NumberPrototype.cpp
563     runtime/ObjectConstructor.cpp
564     runtime/RegExpConstructor.cpp
565     runtime/RegExpObject.cpp
566     runtime/RegExpPrototype.cpp
567     runtime/StringConstructor.cpp
568 )
569
570 set(JavaScriptCore_LIBRARIES
571     WTF
572     ${ICU_I18N_LIBRARIES}
573 )
574
575 if (WTF_USE_UDIS86)
576     set(UDIS_GEN_DEP
577         disassembler/udis86/ud_opcode.py
578         disassembler/udis86/ud_optable.py
579     )
580
581     add_custom_command(
582         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.c ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
583         DEPENDS ${UDIS_GEN_DEP}
584         WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
585         COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/disassembler/udis86/itab.py ${JAVASCRIPTCORE_DIR}/disassembler/udis86/optable.xml
586         VERBATIM)
587
588     list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
589         ${JAVASCRIPTCORE_DIR}/disassembler/udis86
590     )
591     list(APPEND JavaScriptCore_HEADERS
592         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
593     )
594     list(APPEND JavaScriptCore_SOURCES
595         disassembler/udis86/udis86.c
596         disassembler/udis86/udis86_decode.c
597         disassembler/udis86/udis86_input.c
598         disassembler/udis86/udis86_itab_holder.c
599         disassembler/udis86/udis86_syn-att.c
600         disassembler/udis86/udis86_syn-intel.c
601         disassembler/udis86/udis86_syn.c
602         disassembler/UDis86Disassembler.cpp
603     )
604 endif ()
605
606 # We cannot check for RUBY_FOUND because it is set only when the full package is installed and
607 # the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro
608 # for finding the only Ruby interpreter.
609 if (NOT RUBY_EXECUTABLE)
610     message(FATAL_ERROR "The Ruby interpreter is needed to generate LLInt files.")
611 endif ()
612
613 set(LLINT_ASM
614     llint/LowLevelInterpreter.asm
615     llint/LowLevelInterpreter32_64.asm
616     llint/LowLevelInterpreter64.asm
617 )
618
619 set(OFFLINE_ASM
620     offlineasm/arm.rb
621     offlineasm/ast.rb
622     offlineasm/backends.rb
623     offlineasm/cloop.rb
624     offlineasm/config.rb
625     offlineasm/instructions.rb
626     offlineasm/offsets.rb
627     offlineasm/opt.rb
628     offlineasm/parser.rb
629     offlineasm/registers.rb
630     offlineasm/risc.rb
631     offlineasm/self_hash.rb
632     offlineasm/settings.rb
633     offlineasm/transform.rb
634     offlineasm/x86.rb
635 )
636
637 add_custom_command(
638     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
639     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/generate-bytecode-files
640     DEPENDS ${JAVASCRIPTCORE_DIR}/generate-bytecode-files bytecode/BytecodeList.json
641     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/generate-bytecode-files --bytecodes_h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h --init_bytecodes_asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm ${JAVASCRIPTCORE_DIR}/bytecode/BytecodeList.json
642     VERBATIM)
643
644 add_custom_command(
645     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
646     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb
647     DEPENDS ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
648     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
649     VERBATIM)
650
651 # We add the header files directly to the ADD_EXECUTABLE call instead of setting the
652 # OBJECT_DEPENDS property in LLIntOffsetsExtractor.cpp because generate_offset_extractor.rb and
653 # generate-bytecode-files may not regenerate the .h files in case the hash it calculates does not change.
654 # In this case, if some of the dependencies specified in the ADD_CUSTOM_COMMANDs above have
655 # changed the command will always be called because the mtime of the .h files will
656 # always be older than that of their dependencies.
657 # Additionally, setting the OBJECT_DEPENDS property will make the .h files a Makefile
658 # dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will
659 # actually be run multiple times!
660 add_executable(LLIntOffsetsExtractor
661     ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
662     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
663 )
664 target_link_libraries(LLIntOffsetsExtractor WTF)
665
666 # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than
667 # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization
668 # that generates a checksum of the LLIntOffsetsExtractor binary, if the checksum of the new
669 # LLIntOffsetsExtractor matches, no output is generated. To make this target consistent and avoid
670 # running this command for every build, we artificially update LLIntAssembly.h's mtime (using touch)
671 # after every asm.rb run.
672 add_custom_command(
673     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
674     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb
675     DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
676     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}/LLIntAssembly.h
677     COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
678     VERBATIM)
679
680 # The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of
681 # the .cpp files below is similar to the one in the previous comment. However, since these .cpp
682 # files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS
683 # since it is used in the add_library() call at the end of this file.
684 list(APPEND JavaScriptCore_HEADERS
685     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
686 )
687 list(APPEND JavaScriptCore_SOURCES
688     llint/LLIntCLoop.cpp
689     llint/LLIntData.cpp
690     llint/LLIntEntrypoint.cpp
691     llint/LLIntExceptions.cpp
692     llint/LLIntSlowPaths.cpp
693     llint/LLIntThunks.cpp
694     llint/LowLevelInterpreter.cpp
695 )
696
697
698 if (ENABLE_FTL_JIT)
699     if (NOT LLVM_STATIC_LIBRARIES)
700         message(FATAL_ERROR "No LLVM libs found, but FTL is enabled. Stopping build.")
701     endif ()
702
703     # Configure llvmForJSC.so
704     set(llvmForJSC_SOURCES
705         llvm/library/LLVMAnchor.cpp
706         llvm/library/LLVMExports.cpp
707         llvm/library/LLVMOverrides.cpp
708     )
709     set(llvmForJSC_INCLUDE_DIRECTORIES
710         ${LLVM_INCLUDE_DIRS}
711         "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
712     )
713
714     add_custom_command(
715         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h
716         DEPENDS ${LLVM_STATIC_LIBRARIES}
717         COMMAND ${CMAKE_COMMAND} -E touch ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h
718         VERBATIM)
719
720     WEBKIT_WRAP_SOURCELIST(${llvmForJSC_SOURCES})
721     add_library(llvmForJSC SHARED ${llvmForJSC_SOURCES} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h)
722     target_link_libraries(llvmForJSC ${LLVM_STATIC_LIBRARIES} "pthread" "dl")
723
724     # Added extra items for JavaScriptCore
725     list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
726         ${LLVM_INCLUDE_DIRS}
727         ${LIBCXXABI_INCLUDE_DIRS}
728     )
729
730     list(APPEND JavaScriptCore_SOURCES
731         dfg/DFGToFTLDeferredCompilationCallback.cpp
732         dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp
733
734         disassembler/LLVMDisassembler.cpp
735         disassembler/X86Disassembler.cpp
736
737         ftl/FTLAbstractHeap.cpp
738         ftl/FTLAbstractHeapRepository.cpp
739         ftl/FTLAvailableRecovery.cpp
740         ftl/FTLCapabilities.cpp
741         ftl/FTLCommonValues.cpp
742         ftl/FTLCompile.cpp
743         ftl/FTLDWARFDebugLineInfo.cpp
744         ftl/FTLDWARFRegister.cpp
745         ftl/FTLDataSection.cpp
746         ftl/FTLExitArgument.cpp
747         ftl/FTLExitArgumentForOperand.cpp
748         ftl/FTLExitThunkGenerator.cpp
749         ftl/FTLExitValue.cpp
750         ftl/FTLFail.cpp
751         ftl/FTLForOSREntryJITCode.cpp
752         ftl/FTLInlineCacheSize.cpp
753         ftl/FTLIntrinsicRepository.cpp
754         ftl/FTLJITCode.cpp
755         ftl/FTLJITFinalizer.cpp
756         ftl/FTLJSCall.cpp
757         ftl/FTLLink.cpp
758         ftl/FTLLocation.cpp
759         ftl/FTLLowerDFGToLLVM.cpp
760         ftl/FTLOSREntry.cpp
761         ftl/FTLOSRExitCompiler.cpp
762         ftl/FTLOSRExit.cpp
763         ftl/FTLOutput.cpp
764         ftl/FTLRecoveryOpcode.cpp
765         ftl/FTLRegisterAtOffset.cpp
766         ftl/FTLSaveRestore.cpp
767         ftl/FTLSlowPathCall.cpp
768         ftl/FTLSlowPathCallKey.cpp
769         ftl/FTLStackMaps.cpp
770         ftl/FTLState.cpp
771         ftl/FTLThunks.cpp
772         ftl/FTLUnwindInfo.cpp
773         ftl/FTLValueFormat.cpp
774         ftl/FTLValueRange.cpp
775
776         llvm/InitializeLLVM.cpp
777         llvm/InitializeLLVMLinux.cpp
778         llvm/InitializeLLVMPOSIX.cpp
779         llvm/LLVMAPI.cpp
780     )
781 endif ()
782
783 set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table)
784 macro(GENERATE_HASH_LUT _input _output)
785     add_custom_command(
786         OUTPUT ${_output}
787         DEPENDS ${HASH_LUT_GENERATOR} ${_input} ${CMAKE_CURRENT_SOURCE_DIR}/generate-js-builtins
788         COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} -i > ${_output}
789         VERBATIM)
790     list(APPEND JavaScriptCore_HEADERS ${_output})
791 endmacro()
792
793 # GENERATOR 1-A: LUT creator
794 foreach (_file ${JavaScriptCore_LUT_FILES})
795     get_filename_component(_name ${_file} NAME_WE)
796     GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
797 endforeach ()
798
799 set(JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES
800     assembler
801     bindings
802     bytecode
803     debugger
804     heap
805     inspector
806     inspector/agents
807     interpreter
808     jit
809     llint
810     parser
811     profiler
812     runtime
813     yarr
814
815     collector/handles
816     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
817 )
818
819 set(JavaScriptCore_FORWARDING_HEADERS_FILES
820     API/APICallbackFunction.h
821     API/APICast.h
822     API/JSAPIWrapperObject.h
823     API/JSBase.h
824     API/JSBasePrivate.h
825     API/JSCTestRunnerUtils.h
826     API/JSCallbackConstructor.h
827     API/JSCallbackFunction.h
828     API/JSCallbackObject.h
829     API/JSCallbackObjectFunctions.h
830     API/JSClassRef.h
831     API/JSContext.h
832     API/JSContextInternal.h
833     API/JSContextPrivate.h
834     API/JSContextRef.h
835     API/JSContextRefInternal.h
836     API/JSContextRefPrivate.h
837     API/JSExport.h
838     API/JSManagedValue.h
839     API/JSManagedValueInternal.h
840     API/JSObjectRef.h
841     API/JSObjectRefPrivate.h
842     API/JSProfilerPrivate.h
843     API/JSRetainPtr.h
844     API/JSScriptRefPrivate.h
845     API/JSStringRef.h
846     API/JSStringRefBSTR.h
847     API/JSStringRefCF.h
848     API/JSStringRefPrivate.h
849     API/JSValue.h
850     API/JSValueInternal.h
851     API/JSValueRef.h
852     API/JSVirtualMachine.h
853     API/JSVirtualMachineInternal.h
854     API/JSWeakObjectMapRefInternal.h
855     API/JSWeakObjectMapRefPrivate.h
856     API/JSWrapperMap.h
857     API/JavaScript.h
858     API/JavaScriptCore.h
859     API/ObjcRuntimeExtras.h
860     API/OpaqueJSString.h
861     API/WebKitAvailability.h
862
863     assembler/LinkBuffer.h
864     assembler/MacroAssembler.h
865     assembler/MacroAssemblerCodeRef.h
866     assembler/MacroAssemblerCodeRef.h
867     jit/GPRInfo.h
868     runtime/VM.h
869
870     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
871     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.h
872     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
873 )
874
875
876 # GENERATOR 1-B: particular LUT creator (for 1 file only)
877 GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
878
879 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
880 add_custom_command(
881     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
882     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables
883     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
884     VERBATIM)
885 ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
886
887
888 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
889 add_custom_command(
890     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
891     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py
892     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
893     VERBATIM)
894 ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
895
896
897 # Inspector Interfaces
898
899 set(JavaScriptCore_INSPECTOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
900
901 set(JavaScriptCore_INSPECTOR_DOMAINS
902     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json
903     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Debugger.json
904     ${JAVASCRIPTCORE_DIR}/inspector/protocol/GenericTypes.json
905     ${JAVASCRIPTCORE_DIR}/inspector/protocol/InspectorDomain.json
906     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Profiler.json
907     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Runtime.json
908 )
909
910 add_custom_command(
911     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json
912     MAIN_DEPENDENCY ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-combined-inspector-json.py
913     DEPENDS ${JavaScriptCore_INSPECTOR_DOMAINS}
914     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-combined-inspector-json.py ${JavaScriptCore_INSPECTOR_DOMAINS} > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json
915     VERBATIM)
916
917 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
918 add_custom_command(
919     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSBackendDispatchers.cpp
920            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSBackendDispatchers.h
921            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSFrontendDispatchers.cpp
922            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSFrontendDispatchers.h
923            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSTypeBuilders.cpp
924            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSTypeBuilders.h
925            ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorJSBackendCommands.js
926     MAIN_DEPENDENCY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json
927     DEPENDS ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py
928             ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspectorStrings.py
929     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json --output_h_dir "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector" --output_cpp_dir "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector" --output_js_dir "${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol" --output_type JavaScript --write_always
930     VERBATIM)
931 file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
932
933 # JSCBuiltins
934 file(GLOB JSCBuiltins_js_files "${CMAKE_CURRENT_SOURCE_DIR}/builtins/*.js")
935 add_custom_command(
936    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
937    MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/generate-js-builtins
938    DEPENDS ${JSCBuiltins_js_files}
939    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generate-js-builtins ${JSCBuiltins_js_files} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp
940    VERBATIM)
941
942 list(APPEND JavaScriptCore_SOURCES
943     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSBackendDispatchers.cpp
944     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSFrontendDispatchers.cpp
945     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSTypeBuilders.cpp
946     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp
947 )
948
949 list(APPEND JavaScriptCore_HEADERS
950     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSBackendDispatchers.h
951     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSFrontendDispatchers.h
952     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSTypeBuilders.h
953     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
954 )
955
956 add_custom_command(
957     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
958     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js
959     DEPENDS ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py
960     COMMAND echo "//# sourceURL=__WebInspectorInjectedScript__" > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
961     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py < ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js >> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
962     COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl InjectedScriptSource_js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h
963     VERBATIM)
964
965 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h)
966
967 # Web Replay inputs generator
968 if (ENABLE_WEB_REPLAY)
969     set(JavaScript_WEB_REPLAY_INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/replay/JSInputs.json)
970     add_custom_command(
971         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.cpp
972         MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/replay/scripts/CodeGeneratorReplayInputs.py
973         DEPENDS ${JavaScript_WEB_REPLAY_INPUTS}
974         COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/replay/scripts/CodeGeneratorReplayInputs.py --outputDir ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ --framework JavaScriptCore ${JavaScript_WEB_REPLAY_INPUTS}
975         VERBATIM)
976
977     list(APPEND JavaScriptCore_SOURCES
978         replay/EncodedValue.cpp
979         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.cpp
980     )
981     list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.h)
982 endif ()
983
984 if (WTF_CPU_ARM)
985     list(APPEND JavaScriptCore_SOURCES
986         assembler/ARMAssembler.cpp
987         assembler/ARMv7Assembler.cpp
988         assembler/MacroAssemblerARM.cpp
989     )
990     if (MSVC AND ENABLE_JIT)
991         add_custom_command(
992             OUTPUT ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm
993             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_jit_stubs
994             DEPENDS ${JAVASCRIPTCORE_DIR}/jit/JITStubsARM.h
995             DEPENDS ${JAVASCRIPTCORE_DIR}/jit/JITStubs.cpp
996             COMMAND ${PERL_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create_jit_stubs --prefix=MSVC --header ${JAVASCRIPTCORE_DIR}/jit/JITStubsARM.h ${JAVASCRIPTCORE_DIR}/jit/JITStubs.cpp > ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm
997             VERBATIM)
998
999         add_custom_command(
1000             OUTPUT ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj
1001             MAIN_DEPENDENCY ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm
1002             COMMAND armasm -nologo ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj
1003             VERBATIM)
1004
1005         list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj)
1006     endif ()
1007 elseif (WTF_CPU_MIPS)
1008 elseif (WTF_CPU_SH4)
1009 elseif (WTF_CPU_X86)
1010     list(APPEND JavaScriptCore_SOURCES
1011         assembler/MacroAssemblerX86Common.cpp
1012     )
1013 elseif (WTF_CPU_X86_64)
1014     if (MSVC AND ENABLE_JIT)
1015         add_custom_command(
1016             OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj
1017             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1018             COMMAND ml64 -nologo -c -Fo ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1019             VERBATIM)
1020
1021         list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj)
1022     endif ()
1023     list(APPEND JavaScriptCore_SOURCES
1024         assembler/MacroAssemblerX86Common.cpp
1025     )
1026 else ()
1027     message(FATAL_ERROR "Unknown CPU")
1028 endif ()
1029
1030
1031 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
1032
1033 WEBKIT_CREATE_FORWARDING_HEADERS(JavaScriptCore DIRECTORIES ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES} FILES ${JavaScriptCore_FORWARDING_HEADERS_FILES})
1034
1035
1036 add_subdirectory(shell)
1037
1038 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
1039 include_directories(${JavaScriptCore_INCLUDE_DIRECTORIES})
1040 add_library(JavaScriptCore ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
1041 target_link_libraries(JavaScriptCore ${JavaScriptCore_LIBRARIES})
1042 set_target_properties(JavaScriptCore PROPERTIES COMPILE_DEFINITIONS "BUILDING_JavaScriptCore")
1043 set_target_properties(JavaScriptCore PROPERTIES FOLDER "JavaScriptCore")
1044 set_target_properties(JavaScriptCore PROPERTIES LINK_INTERFACE_LIBRARIES "")
1045
1046 if (JavaScriptCore_OUTPUT_NAME)
1047     set_target_properties(JavaScriptCore PROPERTIES OUTPUT_NAME ${JavaScriptCore_OUTPUT_NAME})
1048 endif ()
1049
1050 if (${JavaScriptCore_LIBRARY_TYPE} STREQUAL "SHARED")
1051     POPULATE_LIBRARY_VERSION(JAVASCRIPTCORE)
1052     set_target_properties(JavaScriptCore PROPERTIES VERSION ${JAVASCRIPTCORE_VERSION} SOVERSION ${JAVASCRIPTCORE_VERSION_MAJOR})
1053     install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}")
1054 endif ()
1055
1056 if (ENABLE_FTL_JIT)
1057     add_dependencies(JavaScriptCore llvmForJSC)
1058 endif ()