Fix build break after r154861
[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}/bytecode"
8     "${JAVASCRIPTCORE_DIR}/bytecompiler"
9     "${JAVASCRIPTCORE_DIR}/dfg"
10     "${JAVASCRIPTCORE_DIR}/disassembler"
11     "${JAVASCRIPTCORE_DIR}/ftl"
12     "${JAVASCRIPTCORE_DIR}/heap"
13     "${JAVASCRIPTCORE_DIR}/debugger"
14     "${JAVASCRIPTCORE_DIR}/interpreter"
15     "${JAVASCRIPTCORE_DIR}/jit"
16     "${JAVASCRIPTCORE_DIR}/llint"
17     "${JAVASCRIPTCORE_DIR}/parser"
18     "${JAVASCRIPTCORE_DIR}/profiler"
19     "${JAVASCRIPTCORE_DIR}/runtime"
20     "${JAVASCRIPTCORE_DIR}/tools"
21     "${JAVASCRIPTCORE_DIR}/yarr"
22     "${WTF_DIR}"
23     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
24     "${CMAKE_SOURCE_DIR}/Source"
25 )
26
27 set(JavaScriptCore_SOURCES
28     API/JSBase.cpp
29     API/JSCTestRunnerUtils.cpp
30     API/JSCallbackConstructor.cpp
31     API/JSCallbackFunction.cpp
32     API/JSCallbackObject.cpp
33     API/JSClassRef.cpp
34     API/JSContextRef.cpp
35     API/JSObjectRef.cpp
36     API/JSProfilerPrivate.cpp
37     API/JSScriptRef.cpp
38     API/JSStringRef.cpp
39     API/JSValueRef.cpp
40     API/JSWeakObjectMapRefPrivate.cpp
41     API/OpaqueJSString.cpp
42
43     assembler/MacroAssembler.cpp
44     assembler/LinkBuffer.cpp
45     assembler/MacroAssemblerX86Common.cpp
46
47     bytecode/ArrayAllocationProfile.cpp
48     bytecode/ArrayProfile.cpp
49     bytecode/CallLinkInfo.cpp
50     bytecode/CallLinkStatus.cpp
51     bytecode/CodeBlock.cpp
52     bytecode/CodeBlockHash.cpp
53     bytecode/CodeOrigin.cpp
54     bytecode/CodeType.cpp
55     bytecode/DFGExitProfile.cpp
56     bytecode/DeferredCompilationCallback.cpp
57     bytecode/ExecutionCounter.cpp
58     bytecode/ExitKind.cpp
59     bytecode/GetByIdStatus.cpp
60     bytecode/JumpTable.cpp
61     bytecode/LazyOperandValueProfile.cpp
62     bytecode/MethodOfGettingAValueProfile.cpp
63     bytecode/Opcode.cpp
64     bytecode/PolymorphicPutByIdList.cpp
65     bytecode/PreciseJumpTargets.cpp
66     bytecode/PutByIdStatus.cpp
67     bytecode/ReduceWhitespace.cpp
68     bytecode/SamplingTool.cpp
69     bytecode/SpecialPointer.cpp
70     bytecode/SpeculatedType.cpp
71     bytecode/StructureStubClearingWatchpoint.cpp
72     bytecode/StructureStubInfo.cpp
73     bytecode/UnlinkedCodeBlock.cpp
74     bytecode/Watchpoint.cpp
75
76     bytecompiler/BytecodeGenerator.cpp
77     bytecompiler/NodesCodegen.cpp
78
79     dfg/DFGAbstractHeap.cpp
80     dfg/DFGAbstractValue.cpp
81     dfg/DFGArgumentsSimplificationPhase.cpp
82     dfg/DFGArrayMode.cpp
83     dfg/DFGAssemblyHelpers.cpp
84     dfg/DFGAtTailAbstractState.cpp
85     dfg/DFGBackwardsPropagationPhase.cpp
86     dfg/DFGBasicBlock.cpp
87     dfg/DFGBinarySwitch.cpp
88     dfg/DFGBlockInsertionSet.cpp
89     dfg/DFGByteCodeParser.cpp
90     dfg/DFGCFAPhase.cpp
91     dfg/DFGCFGSimplificationPhase.cpp
92     dfg/DFGCPSRethreadingPhase.cpp
93     dfg/DFGCSEPhase.cpp
94     dfg/DFGCapabilities.cpp
95     dfg/DFGClobberSet.cpp
96     dfg/DFGClobberize.cpp
97     dfg/DFGCommon.cpp
98     dfg/DFGCommonData.cpp
99     dfg/DFGCompilationKey.cpp
100     dfg/DFGCompilationMode.cpp
101     dfg/DFGConstantFoldingPhase.cpp
102     dfg/DFGCriticalEdgeBreakingPhase.cpp
103     dfg/DFGDCEPhase.cpp
104     dfg/DFGDesiredIdentifiers.cpp
105     dfg/DFGDesiredStructureChains.cpp
106     dfg/DFGDesiredTransitions.cpp
107     dfg/DFGDesiredWatchpoints.cpp
108     dfg/DFGDesiredWeakReferences.cpp
109     dfg/DFGDesiredWriteBarriers.cpp
110     dfg/DFGDisassembler.cpp
111     dfg/DFGDominators.cpp
112     dfg/DFGDriver.cpp
113     dfg/DFGEdge.cpp
114     dfg/DFGFailedFinalizer.cpp
115     dfg/DFGFinalizer.cpp
116     dfg/DFGFixupPhase.cpp
117     dfg/DFGFlushFormat.cpp
118     dfg/DFGFlushLivenessAnalysisPhase.cpp
119     dfg/DFGGraph.cpp
120     dfg/DFGInPlaceAbstractState.cpp
121     dfg/DFGJITCode.cpp
122     dfg/DFGJITCompiler.cpp
123     dfg/DFGJITFinalizer.cpp
124     dfg/DFGLICMPhase.cpp
125     dfg/DFGLazyJSValue.cpp
126     dfg/DFGLivenessAnalysisPhase.cpp
127     dfg/DFGLongLivedState.cpp
128     dfg/DFGLoopPreHeaderCreationPhase.cpp
129     dfg/DFGMinifiedNode.cpp
130     dfg/DFGNaturalLoops.cpp
131     dfg/DFGNode.cpp
132     dfg/DFGNodeFlags.cpp
133     dfg/DFGOSRAvailabilityAnalysisPhase.cpp
134     dfg/DFGOSREntry.cpp
135     dfg/DFGOSRExit.cpp
136     dfg/DFGOSRExitBase.cpp
137     dfg/DFGOSRExitCompiler.cpp
138     dfg/DFGOSRExitCompiler32_64.cpp
139     dfg/DFGOSRExitCompiler64.cpp
140     dfg/DFGOSRExitCompilerCommon.cpp
141     dfg/DFGOSRExitJumpPlaceholder.cpp
142     dfg/DFGOSRExitPreparation.cpp
143     dfg/DFGOperations.cpp
144     dfg/DFGPhase.cpp
145     dfg/DFGPlan.cpp
146     dfg/DFGPredictionInjectionPhase.cpp
147     dfg/DFGPredictionPropagationPhase.cpp
148     dfg/DFGRepatch.cpp
149     dfg/DFGSSAConversionPhase.cpp
150     dfg/DFGSpeculativeJIT.cpp
151     dfg/DFGSpeculativeJIT32_64.cpp
152     dfg/DFGSpeculativeJIT64.cpp
153     dfg/DFGThunks.cpp
154     dfg/DFGTypeCheckHoistingPhase.cpp
155     dfg/DFGUnificationPhase.cpp
156     dfg/DFGUseKind.cpp
157     dfg/DFGValidate.cpp
158     dfg/DFGValueSource.cpp
159     dfg/DFGVariableAccessDataDump.cpp
160     dfg/DFGVariableEvent.cpp
161     dfg/DFGVariableEventStream.cpp
162     dfg/DFGVirtualRegisterAllocationPhase.cpp
163     dfg/DFGWorklist.cpp
164
165     disassembler/ARMv7Disassembler.cpp
166     disassembler/Disassembler.cpp
167     disassembler/LLVMDisassembler.cpp
168     disassembler/UDis86Disassembler.cpp
169     disassembler/X86Disassembler.cpp
170
171     heap/BlockAllocator.cpp
172     heap/CopiedSpace.cpp
173     heap/CopyVisitor.cpp
174     heap/ConservativeRoots.cpp
175     heap/DFGCodeBlocks.cpp
176     heap/GCIncomingRefCountedSet.h
177     heap/GCIncomingRefCounted.h
178     heap/GCIncomingRefCountedSetInlines.h
179     heap/GCIncomingRefCountedInlines.h
180     heap/GCThread.cpp
181     heap/GCThreadSharedData.cpp
182     heap/HandleSet.cpp
183     heap/HandleStack.cpp
184     heap/Heap.cpp
185     heap/HeapStatistics.cpp
186     heap/HeapTimer.cpp
187     heap/IncrementalSweeper.cpp
188     heap/JITStubRoutineSet.cpp
189     heap/MachineStackMarker.cpp
190
191     heap/BlockAllocator.cpp
192     heap/ConservativeRoots.cpp
193     heap/CopiedSpace.cpp
194     heap/CopyVisitor.cpp
195     heap/DFGCodeBlocks.cpp
196     heap/GCThread.cpp
197     heap/GCThreadSharedData.cpp
198     heap/HandleSet.cpp
199     heap/HandleStack.cpp
200     heap/Heap.cpp
201     heap/HeapStatistics.cpp
202     heap/HeapTimer.cpp
203     heap/JITStubRoutineSet.cpp
204     heap/MachineStackMarker.cpp
205     heap/MarkStack.cpp
206     heap/MarkedAllocator.cpp
207     heap/MarkedBlock.cpp
208     heap/MarkedSpace.cpp
209     heap/SlotVisitor.cpp
210     heap/SuperRegion.cpp
211     heap/VTableSpectrum.cpp
212     heap/Weak.cpp
213     heap/WeakBlock.cpp
214     heap/WeakHandleOwner.cpp
215     heap/WeakSet.cpp
216     heap/WriteBarrierSupport.cpp
217
218     debugger/Debugger.cpp
219     debugger/DebuggerActivation.cpp
220     debugger/DebuggerCallFrame.cpp
221
222     interpreter/AbstractPC.cpp
223     interpreter/CallFrame.cpp
224     interpreter/Interpreter.cpp
225     interpreter/JSStack.cpp
226     interpreter/StackIterator.cpp
227     interpreter/VMInspector.cpp
228
229     jit/ClosureCallStubRoutine.cpp
230     jit/ExecutableAllocator.cpp
231     jit/ExecutableAllocatorFixedVMPool.cpp
232     jit/GCAwareJITStubRoutine.cpp
233     jit/HostCallReturnValue.cpp
234     jit/JIT.cpp
235     jit/JITArithmetic.cpp
236     jit/JITArithmetic32_64.cpp
237     jit/JITCall.cpp
238     jit/JITCall32_64.cpp
239     jit/JITCode.cpp
240     jit/JITDisassembler.cpp
241     jit/JITExceptions.cpp
242     jit/JITOpcodes.cpp
243     jit/JITOpcodes32_64.cpp
244     jit/JITPropertyAccess.cpp
245     jit/JITPropertyAccess32_64.cpp
246     jit/JITStubRoutine.cpp
247     jit/JITStubs.cpp
248     jit/JITThunks.cpp
249     jit/JITToDFGDeferredCompilationCallback.cpp
250     jit/JumpReplacementWatchpoint.cpp
251     jit/ThunkGenerators.cpp
252
253     parser/Lexer.cpp
254     parser/Nodes.cpp
255     parser/Parser.cpp
256     parser/ParserArena.cpp
257     parser/SourceCode.cpp
258     parser/SourceProvider.cpp
259     parser/SourceProviderCache.cpp
260
261     profiler/ProfilerBytecode.cpp
262     profiler/ProfilerBytecodeSequence.cpp
263     profiler/ProfilerBytecodes.cpp
264     profiler/ProfilerCompilation.cpp
265     profiler/ProfilerCompilationKind.cpp
266     profiler/ProfilerCompiledBytecode.cpp
267     profiler/ProfilerDatabase.cpp
268     profiler/ProfilerOrigin.cpp
269     profiler/ProfilerOriginStack.cpp
270     profiler/ProfilerOSRExit.cpp
271     profiler/ProfilerOSRExitSite.cpp
272     profiler/ProfilerProfiledBytecodes.cpp
273     profiler/Profile.cpp
274     profiler/ProfileGenerator.cpp
275     profiler/ProfileNode.cpp
276     profiler/LegacyProfiler.cpp
277
278     runtime/ArgList.cpp
279     runtime/Arguments.cpp
280     runtime/ArrayBuffer.cpp
281     runtime/ArrayBufferView.cpp
282     runtime/ArrayConstructor.cpp
283     runtime/ArrayPrototype.cpp
284     runtime/BooleanConstructor.cpp
285     runtime/BooleanObject.cpp
286     runtime/BooleanPrototype.cpp
287     runtime/CallData.cpp
288     runtime/CodeCache.cpp
289     runtime/CodeSpecializationKind.cpp
290     runtime/CommonIdentifiers.cpp
291     runtime/CommonSlowPaths.cpp
292     runtime/CommonSlowPathsExceptions.cpp
293     runtime/CompilationResult.cpp
294     runtime/Completion.cpp
295     runtime/ConstructData.cpp
296     runtime/DataView.cpp
297     runtime/DataView.h
298     runtime/DateConstructor.cpp
299     runtime/DateConversion.cpp
300     runtime/DateInstance.cpp
301     runtime/DatePrototype.cpp
302     runtime/DumpContext.cpp
303     runtime/Error.cpp
304     runtime/ErrorConstructor.cpp
305     runtime/ErrorInstance.cpp
306     runtime/ErrorPrototype.cpp
307     runtime/ExceptionHelpers.cpp
308     runtime/Executable.cpp
309     runtime/FunctionConstructor.cpp
310     runtime/FunctionExecutableDump.cpp
311     runtime/FunctionPrototype.cpp
312     runtime/GCActivityCallback.cpp
313     runtime/GetterSetter.cpp
314     runtime/Identifier.cpp
315     runtime/IndexingType.cpp
316     runtime/InitializeThreading.cpp
317     runtime/IntendedStructureChain.cpp
318     runtime/InternalFunction.cpp
319     runtime/JSAPIValueWrapper.cpp
320     runtime/JSActivation.cpp
321     runtime/JSArray.cpp
322     runtime/JSArrayBuffer.cpp
323     runtime/JSArrayBufferConstructor.cpp
324     runtime/JSArrayBufferPrototype.cpp
325     runtime/JSArrayBufferView.cpp
326     runtime/JSBoundFunction.cpp
327     runtime/JSCJSValue.cpp
328     runtime/JSCell.cpp
329     runtime/JSChunk.cpp
330     runtime/JSDataView.cpp
331     runtime/JSDataViewPrototype.cpp
332     runtime/JSDateMath.cpp
333     runtime/JSFunction.cpp
334     runtime/JSGlobalObject.cpp
335     runtime/JSGlobalObjectFunctions.cpp
336     runtime/JSLock.cpp
337     runtime/JSMap.cpp
338     runtime/JSNameScope.cpp
339     runtime/JSNotAnObject.cpp
340     runtime/JSONObject.cpp
341     runtime/JSObject.cpp
342     runtime/JSPromise.cpp
343     runtime/JSPromiseCallback.cpp
344     runtime/JSPromiseConstructor.cpp
345     runtime/JSPromisePrototype.cpp
346     runtime/JSPromiseResolver.cpp
347     runtime/JSPromiseResolverConstructor.cpp
348     runtime/JSPromiseResolverPrototype.cpp
349     runtime/JSPropertyNameIterator.cpp
350     runtime/JSProxy.cpp
351     runtime/JSScope.cpp
352     runtime/JSSegmentedVariableObject.cpp
353     runtime/JSStaticScopeObject.cpp
354     runtime/JSString.cpp
355     runtime/JSStringJoiner.cpp
356     runtime/JSSymbolTableObject.cpp
357     runtime/JSTypedArrayConstructors.cpp
358     runtime/JSTypedArrayPrototypes.cpp
359     runtime/JSTypedArrays.cpp
360     runtime/JSVariableObject.cpp
361     runtime/JSWithScope.cpp
362     runtime/JSWrapperObject.cpp
363     runtime/LiteralParser.cpp
364     runtime/Lookup.cpp
365     runtime/MapConstructor.cpp
366     runtime/MapData.cpp
367     runtime/MapPrototype.cpp
368     runtime/MathObject.cpp
369     runtime/MemoryStatistics.cpp
370     runtime/NameConstructor.cpp
371     runtime/NameInstance.cpp
372     runtime/NamePrototype.cpp
373     runtime/NativeErrorConstructor.cpp
374     runtime/NativeErrorPrototype.cpp
375     runtime/NumberConstructor.cpp
376     runtime/NumberObject.cpp
377     runtime/NumberPrototype.cpp
378     runtime/ObjectConstructor.cpp
379     runtime/ObjectPrototype.cpp
380     runtime/Operations.cpp
381     runtime/Options.cpp
382     runtime/PropertyDescriptor.cpp
383     runtime/PropertyNameArray.cpp
384     runtime/PropertySlot.cpp
385     runtime/PropertyTable.cpp
386     runtime/PrototypeMap.cpp
387     runtime/RegExp.cpp
388     runtime/RegExpCache.cpp
389     runtime/RegExpCachedResult.cpp
390     runtime/RegExpConstructor.cpp
391     runtime/RegExpMatchesArray.cpp
392     runtime/RegExpObject.cpp
393     runtime/RegExpPrototype.cpp
394     runtime/SamplingCounter.cpp
395     runtime/SimpleTypedArrayController.cpp
396     runtime/SmallStrings.cpp
397     runtime/SparseArrayValueMap.cpp
398     runtime/StrictEvalActivation.cpp
399     runtime/StringConstructor.cpp
400     runtime/StringObject.cpp
401     runtime/StringPrototype.cpp
402     runtime/StringRecursionChecker.cpp
403     runtime/Structure.cpp
404     runtime/StructureChain.cpp
405     runtime/StructureRareData.cpp
406     runtime/SymbolTable.cpp
407     runtime/TypedArrayController.cpp
408     runtime/TypedArrayType.cpp
409     runtime/VM.cpp
410     runtime/Watchdog.cpp
411     runtime/WatchdogNone.cpp
412
413     tools/CodeProfile.cpp
414     tools/CodeProfiling.cpp
415
416     yarr/YarrCanonicalizeUCS2.cpp
417     yarr/YarrPattern.cpp
418     yarr/YarrInterpreter.cpp
419     yarr/YarrJIT.cpp
420     yarr/YarrSyntaxChecker.cpp
421 )
422
423 set(JavaScriptCore_LUT_FILES
424     runtime/ArrayConstructor.cpp
425     runtime/ArrayPrototype.cpp
426     runtime/BooleanPrototype.cpp
427     runtime/DateConstructor.cpp
428     runtime/DatePrototype.cpp
429     runtime/ErrorPrototype.cpp
430     runtime/JSDataViewPrototype.cpp
431     runtime/JSGlobalObject.cpp
432     runtime/JSONObject.cpp
433     runtime/JSPromiseConstructor.cpp
434     runtime/JSPromisePrototype.cpp
435     runtime/JSPromiseResolverPrototype.cpp
436     runtime/NamePrototype.cpp
437     runtime/NumberConstructor.cpp
438     runtime/NumberPrototype.cpp
439     runtime/ObjectConstructor.cpp
440     runtime/RegExpConstructor.cpp
441     runtime/RegExpObject.cpp
442     runtime/RegExpPrototype.cpp
443     runtime/StringConstructor.cpp
444 )
445
446 set(JavaScriptCore_LIBRARIES
447     WTF
448 )
449
450 if (WTF_USE_ICU_UNICODE)
451     list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
452         ${ICU_INCLUDE_DIRS}
453     )
454     list(APPEND JavaScriptCore_LIBRARIES
455         ${ICU_I18N_LIBRARIES}
456     )
457 endif ()
458
459 if (ENABLE_LLINT)
460     # We cannot check for RUBY_FOUND because it is set only when the full package is installed and
461     # the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro
462     # for finding the only Ruby interpreter.
463     if (NOT RUBY_EXECUTABLE)
464         message(FATAL_ERROR "The Ruby interpreter is needed to generate LLInt files.")
465     endif ()
466
467     set(LLINT_ASM
468         llint/LowLevelInterpreter.asm
469         llint/LowLevelInterpreter32_64.asm
470         llint/LowLevelInterpreter64.asm
471     )
472
473     set(OFFLINE_ASM
474         offlineasm/arm.rb
475         offlineasm/ast.rb
476         offlineasm/backends.rb
477         offlineasm/cloop.rb
478         offlineasm/config.rb
479         offlineasm/instructions.rb
480         offlineasm/offsets.rb
481         offlineasm/opt.rb
482         offlineasm/parser.rb
483         offlineasm/registers.rb
484         offlineasm/risc.rb
485         offlineasm/self_hash.rb
486         offlineasm/settings.rb
487         offlineasm/transform.rb
488         offlineasm/x86.rb
489     )
490
491     add_custom_command(
492         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
493         MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb
494         DEPENDS ${LLINT_ASM} ${OFFLINE_ASM}
495         COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
496         VERBATIM)
497
498     # We add the header file directly to the ADD_EXECUTABLE call instead of setting the
499     # OBJECT_DEPENDS property in LLIntOffsetsExtractor.cpp because generate_offset_extractor.rb may
500     # not regenerate it in case the hash it calculates does not change.
501     # In this case, if some of the dependencies specified in the ADD_CUSTOM_COMMAND above have
502     # changed the command will always be called because the mtime of LLIntDesiredOffsets.h will
503     # always be older than that of its dependencies.
504     # Additionally, setting the OBJECT_DEPENDS property will make LLIntDesiredOffsets.h a Makefile
505     # dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will
506     # actually be run twice!
507     add_executable(LLIntOffsetsExtractor
508         ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
509         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
510     )
511     target_link_libraries(LLIntOffsetsExtractor WTF)
512
513     # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than
514     # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization
515     # that generates a checksum of the LLIntOffsetsExtractor binary, if the checksum of the new
516     # LLIntOffsetsExtractor matches, no output is generated. To make this target consistent and avoid
517     # running this command for every build, we artificially update LLIntAssembly.h's mtime (using touch)
518     # after every asm.rb run.
519     add_custom_command(
520         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
521         MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb
522         DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM}
523         COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
524         COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
525         VERBATIM)
526
527     # The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of
528     # the .cpp files below is similar to the one in the previous comment. However, since these .cpp
529     # files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS
530     # since it is used in the add_library() call at the end of this file.
531     list(APPEND JavaScriptCore_HEADERS
532         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
533     )
534     list(APPEND JavaScriptCore_SOURCES
535         llint/LLIntCLoop.cpp
536         llint/LLIntData.cpp
537         llint/LLIntEntrypoint.cpp
538         llint/LLIntExceptions.cpp
539         llint/LLIntSlowPaths.cpp
540         llint/LLIntThunks.cpp
541         llint/LowLevelInterpreter.cpp
542     )
543 endif ()
544
545 set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table)
546 macro(GENERATE_HASH_LUT _input _output)
547     add_custom_command(
548         OUTPUT ${_output}
549         DEPENDS ${HASH_LUT_GENERATOR} ${_input}
550         COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} -i > ${_output}
551         VERBATIM)
552     list(APPEND JavaScriptCore_HEADERS ${_output})
553 endmacro()
554
555 # GENERATOR 1-A: LUT creator
556 foreach (_file ${JavaScriptCore_LUT_FILES})
557     get_filename_component(_name ${_file} NAME_WE)
558     GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
559 endforeach ()
560
561 set(JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES
562     assembler
563     bytecode
564     collector/handles
565     debugger
566     heap
567     interpreter
568     jit
569     llint
570     parser
571     profiler
572     runtime
573     yarr
574 )
575
576 set(JavaScriptCore_FORWARDING_HEADERS_FILES
577     API/APICast.h
578     API/APIShims.h
579     API/JavaScript.h
580     API/JSBase.h
581     API/JSCTestRunnerUtils.h
582     API/JSContextRef.h
583     API/JSContextRefPrivate.h
584     API/JSObjectRef.h
585     API/JSObjectRefPrivate.h
586     API/JSScriptRefPrivate.h
587     API/JSStringRef.h
588     API/JSStringRefCF.h
589     API/JSStringRefBSTR.h
590     API/JSValueRef.h
591     API/JavaScriptCore.h
592     API/JSRetainPtr.h
593     API/JSWeakObjectMapRefInternal.h
594     API/JSWeakObjectMapRefPrivate.h
595     API/JSRetainPtr.h
596     API/OpaqueJSString.h
597     API/WebKitAvailability.h
598 )
599
600
601 # GENERATOR 1-B: particular LUT creator (for 1 file only)
602 GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
603
604 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
605 add_custom_command(
606     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
607     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables
608     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
609     VERBATIM)
610 ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
611
612
613 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
614 add_custom_command(
615     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
616     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py
617     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
618     VERBATIM)
619 ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
620
621 if (WTF_CPU_ARM)
622     list(APPEND JavaScriptCore_SOURCES
623         assembler/ARMAssembler.cpp
624         assembler/ARMv7Assembler.cpp
625         assembler/MacroAssemblerARM.cpp
626     )
627     if (MSVC AND ENABLE_JIT)
628         add_custom_command(
629             OUTPUT ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm
630             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_jit_stubs
631             DEPENDS ${JAVASCRIPTCORE_DIR}/jit/JITStubsARM.h
632             DEPENDS ${JAVASCRIPTCORE_DIR}/jit/JITStubs.cpp
633             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
634             VERBATIM)
635
636         add_custom_command(
637             OUTPUT ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj
638             MAIN_DEPENDENCY ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm
639             COMMAND armasm -nologo ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj
640             VERBATIM)
641
642         list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj)
643     endif ()
644 elseif (WTF_CPU_MIPS)
645 elseif (WTF_CPU_X86)
646     list(APPEND JavaScriptCore_SOURCES
647         assembler/MacroAssemblerX86Common.cpp
648     )
649 elseif (WTF_CPU_X86_64)
650     if (MSVC AND ENABLE_JIT)
651         add_custom_command(
652             OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj
653             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
654             COMMAND ml64 -nologo -c -Fo ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
655             VERBATIM)
656
657         list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj)
658     endif ()
659     list(APPEND JavaScriptCore_SOURCES
660         assembler/MacroAssemblerX86Common.cpp
661     )
662 else ()
663     message(FATAL_ERROR "Unknown CPU")
664 endif ()
665
666
667 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
668
669 WEBKIT_CREATE_FORWARDING_HEADERS(JavaScriptCore DIRECTORIES ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES} FILES ${JavaScriptCore_FORWARDING_HEADERS_FILES})
670
671
672 add_subdirectory(shell)
673
674 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
675 include_directories(${JavaScriptCore_INCLUDE_DIRECTORIES})
676 add_definitions(-DBUILDING_JavaScriptCore -DSTATICALLY_LINKED_WITH_WTF)
677 add_library(JavaScriptCore ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
678 target_link_libraries(JavaScriptCore ${JavaScriptCore_LIBRARIES})
679 set_target_properties(JavaScriptCore PROPERTIES FOLDER "JavaScriptCore")
680 set_target_properties(JavaScriptCore PROPERTIES LINK_INTERFACE_LIBRARIES "")
681
682 if (JavaScriptCore_OUTPUT_NAME)
683     set_target_properties(JavaScriptCore PROPERTIES OUTPUT_NAME ${JavaScriptCore_OUTPUT_NAME})
684 endif ()
685
686 if (SHARED_CORE)
687     set_target_properties(JavaScriptCore PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
688     install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}")
689 endif ()