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