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