CMakeLists.txt 31.7 KB
Newer Older
1
set(JavaScriptCore_INCLUDE_DIRECTORIES
2 3 4 5 6
    "${CMAKE_BINARY_DIR}"
    "${JAVASCRIPTCORE_DIR}"
    "${JAVASCRIPTCORE_DIR}/API"
    "${JAVASCRIPTCORE_DIR}/ForwardingHeaders"
    "${JAVASCRIPTCORE_DIR}/assembler"
7
    "${JAVASCRIPTCORE_DIR}/bindings"
8 9
    "${JAVASCRIPTCORE_DIR}/bytecode"
    "${JAVASCRIPTCORE_DIR}/bytecompiler"
10
    "${JAVASCRIPTCORE_DIR}/dfg"
11
    "${JAVASCRIPTCORE_DIR}/disassembler"
12
    "${JAVASCRIPTCORE_DIR}/ftl"
13
    "${JAVASCRIPTCORE_DIR}/heap"
14
    "${JAVASCRIPTCORE_DIR}/debugger"
15
    "${JAVASCRIPTCORE_DIR}/inspector"
16
    "${JAVASCRIPTCORE_DIR}/inspector/agents"
17 18
    "${JAVASCRIPTCORE_DIR}/interpreter"
    "${JAVASCRIPTCORE_DIR}/jit"
19
    "${JAVASCRIPTCORE_DIR}/llint"
20
    "${JAVASCRIPTCORE_DIR}/llvm"
21 22 23
    "${JAVASCRIPTCORE_DIR}/parser"
    "${JAVASCRIPTCORE_DIR}/profiler"
    "${JAVASCRIPTCORE_DIR}/runtime"
24
    "${JAVASCRIPTCORE_DIR}/tools"
25
    "${JAVASCRIPTCORE_DIR}/yarr"
26
    "${WTF_DIR}"
27
    "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
28
    "${CMAKE_SOURCE_DIR}/Source"
29 30
)

31
set(JavaScriptCore_SOURCES
32
    API/JSBase.cpp
33
    API/JSCTestRunnerUtils.cpp
34 35 36 37 38 39 40
    API/JSCallbackConstructor.cpp
    API/JSCallbackFunction.cpp
    API/JSCallbackObject.cpp
    API/JSClassRef.cpp
    API/JSContextRef.cpp
    API/JSObjectRef.cpp
    API/JSProfilerPrivate.cpp
41
    API/JSScriptRef.cpp
42 43 44 45
    API/JSStringRef.cpp
    API/JSValueRef.cpp
    API/JSWeakObjectMapRefPrivate.cpp
    API/OpaqueJSString.cpp
46

47
    assembler/LinkBuffer.cpp
48
    assembler/MacroAssembler.cpp
49
    assembler/MacroAssemblerX86Common.cpp
50

51 52 53 54
    bindings/ScriptFunctionCall.cpp
    bindings/ScriptObject.cpp
    bindings/ScriptValue.cpp

55
    bytecode/ArrayAllocationProfile.cpp
56
    bytecode/ArrayProfile.cpp
57 58
    bytecode/BytecodeBasicBlock.cpp
    bytecode/BytecodeLivenessAnalysis.cpp
59
    bytecode/CallLinkInfo.cpp
60
    bytecode/CallLinkStatus.cpp
61
    bytecode/CodeBlock.cpp
62
    bytecode/CodeBlockHash.cpp
63
    bytecode/CodeBlockJettisoningWatchpoint.cpp
64 65
    bytecode/CodeOrigin.cpp
    bytecode/CodeType.cpp
66
    bytecode/DFGExitProfile.cpp
67
    bytecode/DeferredCompilationCallback.cpp
68
    bytecode/ExecutionCounter.cpp
69
    bytecode/ExitKind.cpp
70
    bytecode/GetByIdStatus.cpp
71
    bytecode/InlineCallFrameSet.cpp
72
    bytecode/JumpTable.cpp
73 74
    bytecode/LazyOperandValueProfile.cpp
    bytecode/MethodOfGettingAValueProfile.cpp
75
    bytecode/Opcode.cpp
76
    bytecode/PolymorphicPutByIdList.cpp
77
    bytecode/PreciseJumpTargets.cpp
78
    bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp
79
    bytecode/PutByIdStatus.cpp
80
    bytecode/ReduceWhitespace.cpp
81
    bytecode/SamplingTool.cpp
82
    bytecode/SpecialPointer.cpp
83
    bytecode/SpeculatedType.cpp
84
    bytecode/StructureStubClearingWatchpoint.cpp
85
    bytecode/StructureStubInfo.cpp
86
    bytecode/UnlinkedCodeBlock.cpp
87
    bytecode/ValueRecovery.cpp
88
    bytecode/Watchpoint.cpp
89 90 91 92

    bytecompiler/BytecodeGenerator.cpp
    bytecompiler/NodesCodegen.cpp

93 94 95 96
    debugger/Debugger.cpp
    debugger/DebuggerActivation.cpp
    debugger/DebuggerCallFrame.cpp

97 98
    dfg/DFGAbstractHeap.cpp
    dfg/DFGAbstractValue.cpp
99
    dfg/DFGArgumentsSimplificationPhase.cpp
100
    dfg/DFGArithMode.cpp
101
    dfg/DFGArrayMode.cpp
102
    dfg/DFGAtTailAbstractState.cpp
103
    dfg/DFGAvailability.cpp
104
    dfg/DFGBackwardsPropagationPhase.cpp
105 106 107
    dfg/DFGBasicBlock.cpp
    dfg/DFGBinarySwitch.cpp
    dfg/DFGBlockInsertionSet.cpp
108
    dfg/DFGByteCodeParser.cpp
109
    dfg/DFGCFAPhase.cpp
110
    dfg/DFGCFGSimplificationPhase.cpp
111
    dfg/DFGCPSRethreadingPhase.cpp
112
    dfg/DFGCSEPhase.cpp
113 114 115 116 117
    dfg/DFGCapabilities.cpp
    dfg/DFGClobberSet.cpp
    dfg/DFGClobberize.cpp
    dfg/DFGCommon.cpp
    dfg/DFGCommonData.cpp
118 119
    dfg/DFGCompilationKey.cpp
    dfg/DFGCompilationMode.cpp
120 121
    dfg/DFGConstantFoldingPhase.cpp
    dfg/DFGCriticalEdgeBreakingPhase.cpp
122
    dfg/DFGDCEPhase.cpp
123 124
    dfg/DFGDesiredIdentifiers.cpp
    dfg/DFGDesiredStructureChains.cpp
125
    dfg/DFGDesiredTransitions.cpp
126
    dfg/DFGDesiredWatchpoints.cpp
127 128
    dfg/DFGDesiredWeakReferences.cpp
    dfg/DFGDesiredWriteBarriers.cpp
129
    dfg/DFGDisassembler.cpp
130
    dfg/DFGDominators.cpp
131
    dfg/DFGDriver.cpp
132
    dfg/DFGEdge.cpp
133 134
    dfg/DFGFailedFinalizer.cpp
    dfg/DFGFinalizer.cpp
135
    dfg/DFGFixupPhase.cpp
136 137
    dfg/DFGFlushFormat.cpp
    dfg/DFGFlushLivenessAnalysisPhase.cpp
fpizlo@apple.com's avatar
fpizlo@apple.com committed
138
    dfg/DFGFlushedAt.cpp
139
    dfg/DFGGraph.cpp
140
    dfg/DFGInPlaceAbstractState.cpp
141
    dfg/DFGInvalidationPointInjectionPhase.cpp
142
    dfg/DFGJITCode.cpp
143
    dfg/DFGJITCompiler.cpp
144
    dfg/DFGJITFinalizer.cpp
145
    dfg/DFGJumpReplacement.cpp
146 147 148
    dfg/DFGLICMPhase.cpp
    dfg/DFGLazyJSValue.cpp
    dfg/DFGLivenessAnalysisPhase.cpp
149
    dfg/DFGLongLivedState.cpp
150
    dfg/DFGLoopPreHeaderCreationPhase.cpp
151
    dfg/DFGMinifiedNode.cpp
152
    dfg/DFGNaturalLoops.cpp
153
    dfg/DFGNode.cpp
154
    dfg/DFGNodeFlags.cpp
155
    dfg/DFGOSRAvailabilityAnalysisPhase.cpp
156
    dfg/DFGOSREntry.cpp
157
    dfg/DFGOSREntrypointCreationPhase.cpp
158
    dfg/DFGOSRExit.cpp
159
    dfg/DFGOSRExitBase.cpp
160 161 162
    dfg/DFGOSRExitCompiler.cpp
    dfg/DFGOSRExitCompiler32_64.cpp
    dfg/DFGOSRExitCompiler64.cpp
163
    dfg/DFGOSRExitCompilerCommon.cpp
164
    dfg/DFGOSRExitJumpPlaceholder.cpp
165
    dfg/DFGOSRExitPreparation.cpp
166
    dfg/DFGOperations.cpp
167
    dfg/DFGPhase.cpp
168
    dfg/DFGPlan.cpp
169
    dfg/DFGPredictionInjectionPhase.cpp
170
    dfg/DFGPredictionPropagationPhase.cpp
171
    dfg/DFGResurrectionForValidationPhase.cpp
172
    dfg/DFGSSAConversionPhase.cpp
173
    dfg/DFGSSALoweringPhase.cpp
174 175 176
    dfg/DFGSpeculativeJIT.cpp
    dfg/DFGSpeculativeJIT32_64.cpp
    dfg/DFGSpeculativeJIT64.cpp
fpizlo@apple.com's avatar
fpizlo@apple.com committed
177
    dfg/DFGStackLayoutPhase.cpp
178
    dfg/DFGStoreBarrierElisionPhase.cpp
179
    dfg/DFGStrengthReductionPhase.cpp
180
    dfg/DFGThunks.cpp
181
    dfg/DFGTierUpCheckInjectionPhase.cpp
182
    dfg/DFGTypeCheckHoistingPhase.cpp
183
    dfg/DFGUnificationPhase.cpp
184
    dfg/DFGUseKind.cpp
185
    dfg/DFGValidate.cpp
186
    dfg/DFGValueSource.cpp
187
    dfg/DFGVariableAccessDataDump.cpp
188 189
    dfg/DFGVariableEvent.cpp
    dfg/DFGVariableEventStream.cpp
190
    dfg/DFGVirtualRegisterAllocationPhase.cpp
191
    dfg/DFGWatchpointCollectionPhase.cpp
192
    dfg/DFGWorklist.cpp
193

194
    disassembler/ARMv7Disassembler.cpp
195
    disassembler/Disassembler.cpp
196 197 198
    disassembler/LLVMDisassembler.cpp
    disassembler/UDis86Disassembler.cpp
    disassembler/X86Disassembler.cpp
199

200
    heap/BlockAllocator.cpp
201
    heap/CodeBlockSet.cpp
202 203 204
    heap/ConservativeRoots.cpp
    heap/CopiedSpace.cpp
    heap/CopyVisitor.cpp
205
    heap/DeferGC.cpp
206 207 208 209 210 211 212
    heap/GCThread.cpp
    heap/GCThreadSharedData.cpp
    heap/HandleSet.cpp
    heap/HandleStack.cpp
    heap/Heap.cpp
    heap/HeapStatistics.cpp
    heap/HeapTimer.cpp
213
    heap/IncrementalSweeper.cpp
214 215 216
    heap/JITStubRoutineSet.cpp
    heap/MachineStackMarker.cpp
    heap/MarkStack.cpp
217
    heap/MarkedAllocator.cpp
218
    heap/MarkedBlock.cpp
219
    heap/MarkedSpace.cpp
220
    heap/SlotVisitor.cpp
221
    heap/SuperRegion.cpp
222
    heap/Weak.cpp
223
    heap/WeakBlock.cpp
224 225
    heap/WeakHandleOwner.cpp
    heap/WeakSet.cpp
226
    heap/WriteBarrierBuffer.cpp
227
    heap/WriteBarrierSupport.cpp
228

229 230 231
    inspector/InspectorAgentRegistry.cpp
    inspector/InspectorBackendDispatcher.cpp
    inspector/InspectorValues.cpp
232 233 234 235 236 237 238
    inspector/InjectedScript.cpp
    inspector/InjectedScriptBase.cpp
    inspector/InjectedScriptHost.cpp
    inspector/InjectedScriptManager.cpp
    inspector/InjectedScriptModule.cpp
    inspector/JSInjectedScriptHost.cpp
    inspector/JSInjectedScriptHostPrototype.cpp
239
    inspector/agents/InspectorAgent.cpp
240

241
    interpreter/AbstractPC.cpp
242 243
    interpreter/CallFrame.cpp
    interpreter/Interpreter.cpp
244
    interpreter/JSStack.cpp
245
    interpreter/ProtoCallFrame.cpp
246
    interpreter/StackVisitor.cpp
247
    interpreter/VMInspector.cpp
248

249
    jit/AssemblyHelpers.cpp
250
    jit/ClosureCallStubRoutine.cpp
251
    jit/ExecutableAllocator.cpp
252
    jit/ExecutableAllocatorFixedVMPool.cpp
253
    jit/GCAwareJITStubRoutine.cpp
254 255
    jit/HostCallReturnValue.cpp
    jit/JIT.cpp
256
    jit/JITArithmetic.cpp
257
    jit/JITArithmetic32_64.cpp
258
    jit/JITCall.cpp
259
    jit/JITCall32_64.cpp
260
    jit/JITCode.cpp
261
    jit/JITDisassembler.cpp
262
    jit/JITExceptions.cpp
263
    jit/JITInlineCacheGenerator.cpp
264
    jit/JITOpcodes.cpp
265
    jit/JITOpcodes32_64.cpp
266
    jit/JITOperations.cpp
267
    jit/JITPropertyAccess.cpp
268
    jit/JITPropertyAccess32_64.cpp
269
    jit/JITStubRoutine.cpp
270
    jit/JITStubs.cpp
271
    jit/JITThunks.cpp
272
    jit/JITToDFGDeferredCompilationCallback.cpp
273
    jit/RegisterSet.cpp
274
    jit/Repatch.cpp
275
    jit/TempRegisterSet.cpp
276
    jit/ThunkGenerators.cpp
277 278 279 280 281

    parser/Lexer.cpp
    parser/Nodes.cpp
    parser/Parser.cpp
    parser/ParserArena.cpp
282
    parser/SourceCode.cpp
283
    parser/SourceProvider.cpp
284
    parser/SourceProviderCache.cpp
285

286 287 288 289
    profiler/LegacyProfiler.cpp
    profiler/Profile.cpp
    profiler/ProfileGenerator.cpp
    profiler/ProfileNode.cpp
290
    profiler/ProfilerBytecode.cpp
291
    profiler/ProfilerBytecodeSequence.cpp
292 293 294 295 296
    profiler/ProfilerBytecodes.cpp
    profiler/ProfilerCompilation.cpp
    profiler/ProfilerCompilationKind.cpp
    profiler/ProfilerCompiledBytecode.cpp
    profiler/ProfilerDatabase.cpp
297 298
    profiler/ProfilerOSRExit.cpp
    profiler/ProfilerOSRExitSite.cpp
299 300
    profiler/ProfilerOrigin.cpp
    profiler/ProfilerOriginStack.cpp
301
    profiler/ProfilerProfiledBytecodes.cpp
302 303 304

    runtime/ArgList.cpp
    runtime/Arguments.cpp
305 306
    runtime/ArgumentsIteratorConstructor.cpp
    runtime/ArgumentsIteratorPrototype.cpp
307
    runtime/ArrayBuffer.cpp
308
    runtime/ArrayBufferNeuteringWatchpoint.cpp
309
    runtime/ArrayBufferView.cpp
310
    runtime/ArrayConstructor.cpp
311 312
    runtime/ArrayIteratorConstructor.cpp
    runtime/ArrayIteratorPrototype.cpp
313 314 315 316 317
    runtime/ArrayPrototype.cpp
    runtime/BooleanConstructor.cpp
    runtime/BooleanObject.cpp
    runtime/BooleanPrototype.cpp
    runtime/CallData.cpp
318
    runtime/CodeCache.cpp
319
    runtime/CodeSpecializationKind.cpp
320
    runtime/CommonIdentifiers.cpp
321
    runtime/CommonSlowPaths.cpp
322
    runtime/CommonSlowPathsExceptions.cpp
323
    runtime/CompilationResult.cpp
324 325
    runtime/Completion.cpp
    runtime/ConstructData.cpp
326 327
    runtime/DataView.cpp
    runtime/DataView.h
328 329 330 331
    runtime/DateConstructor.cpp
    runtime/DateConversion.cpp
    runtime/DateInstance.cpp
    runtime/DatePrototype.cpp
332
    runtime/DumpContext.cpp
333 334 335 336 337 338 339
    runtime/Error.cpp
    runtime/ErrorConstructor.cpp
    runtime/ErrorInstance.cpp
    runtime/ErrorPrototype.cpp
    runtime/ExceptionHelpers.cpp
    runtime/Executable.cpp
    runtime/FunctionConstructor.cpp
340
    runtime/FunctionExecutableDump.cpp
341
    runtime/FunctionPrototype.cpp
342
    runtime/GCActivityCallback.cpp
343 344
    runtime/GetterSetter.cpp
    runtime/Identifier.cpp
345
    runtime/IndexingType.cpp
346
    runtime/InitializeThreading.cpp
347
    runtime/IntendedStructureChain.cpp
348 349
    runtime/InternalFunction.cpp
    runtime/JSAPIValueWrapper.cpp
350
    runtime/JSActivation.cpp
351
    runtime/JSArgumentsIterator.cpp
352
    runtime/JSArray.cpp
353 354 355 356
    runtime/JSArrayBuffer.cpp
    runtime/JSArrayBufferConstructor.cpp
    runtime/JSArrayBufferPrototype.cpp
    runtime/JSArrayBufferView.cpp
357
    runtime/JSArrayIterator.cpp
358 359
    runtime/JSBoundFunction.cpp
    runtime/JSCJSValue.cpp
360
    runtime/JSCell.cpp
361 362
    runtime/JSDataView.cpp
    runtime/JSDataViewPrototype.cpp
363
    runtime/JSDateMath.cpp
364 365 366 367
    runtime/JSFunction.cpp
    runtime/JSGlobalObject.cpp
    runtime/JSGlobalObjectFunctions.cpp
    runtime/JSLock.cpp
oliver@apple.com's avatar
oliver@apple.com committed
368
    runtime/JSMap.cpp
oliver@apple.com's avatar
oliver@apple.com committed
369
    runtime/JSMapIterator.cpp
370
    runtime/JSNameScope.cpp
371 372
    runtime/JSNotAnObject.cpp
    runtime/JSONObject.cpp
373
    runtime/JSObject.cpp
weinig@apple.com's avatar
weinig@apple.com committed
374 375
    runtime/JSPromise.cpp
    runtime/JSPromiseConstructor.cpp
376 377 378
    runtime/JSPromiseDeferred.cpp
    runtime/JSPromiseFunctions.cpp
    runtime/JSPromiseReaction.cpp
weinig@apple.com's avatar
weinig@apple.com committed
379
    runtime/JSPromisePrototype.cpp
380
    runtime/JSPropertyNameIterator.cpp
381
    runtime/JSProxy.cpp
382
    runtime/JSScope.cpp
383
    runtime/JSSegmentedVariableObject.cpp
oliver@apple.com's avatar
oliver@apple.com committed
384
    runtime/JSSet.cpp
oliver@apple.com's avatar
oliver@apple.com committed
385
    runtime/JSSetIterator.cpp
386
    runtime/JSStaticScopeObject.cpp
387
    runtime/JSString.cpp
388
    runtime/JSStringJoiner.cpp
389
    runtime/JSSymbolTableObject.cpp
390 391 392
    runtime/JSTypedArrayConstructors.cpp
    runtime/JSTypedArrayPrototypes.cpp
    runtime/JSTypedArrays.cpp
393
    runtime/JSVariableObject.cpp
oliver@apple.com's avatar
oliver@apple.com committed
394
    runtime/JSWeakMap.cpp
395
    runtime/JSWithScope.cpp
396 397 398
    runtime/JSWrapperObject.cpp
    runtime/LiteralParser.cpp
    runtime/Lookup.cpp
399
    runtime/MapConstructor.cpp
oliver@apple.com's avatar
oliver@apple.com committed
400
    runtime/MapData.cpp
oliver@apple.com's avatar
oliver@apple.com committed
401 402
    runtime/MapIteratorConstructor.cpp
    runtime/MapIteratorPrototype.cpp
403
    runtime/MapPrototype.cpp
404
    runtime/MathObject.cpp
405
    runtime/MemoryStatistics.cpp
406 407 408
    runtime/NameConstructor.cpp
    runtime/NameInstance.cpp
    runtime/NamePrototype.cpp
409 410 411 412 413 414 415 416
    runtime/NativeErrorConstructor.cpp
    runtime/NativeErrorPrototype.cpp
    runtime/NumberConstructor.cpp
    runtime/NumberObject.cpp
    runtime/NumberPrototype.cpp
    runtime/ObjectConstructor.cpp
    runtime/ObjectPrototype.cpp
    runtime/Operations.cpp
417
    runtime/Options.cpp
418 419 420
    runtime/PropertyDescriptor.cpp
    runtime/PropertyNameArray.cpp
    runtime/PropertySlot.cpp
421
    runtime/PropertyTable.cpp
422
    runtime/PrototypeMap.cpp
423
    runtime/RegExp.cpp
424
    runtime/RegExpCache.cpp
425
    runtime/RegExpCachedResult.cpp
426
    runtime/RegExpConstructor.cpp
427
    runtime/RegExpMatchesArray.cpp
428 429
    runtime/RegExpObject.cpp
    runtime/RegExpPrototype.cpp
430
    runtime/SamplingCounter.cpp
oliver@apple.com's avatar
oliver@apple.com committed
431
    runtime/SetConstructor.cpp
oliver@apple.com's avatar
oliver@apple.com committed
432 433
    runtime/SetIteratorConstructor.cpp
    runtime/SetIteratorPrototype.cpp
oliver@apple.com's avatar
oliver@apple.com committed
434
    runtime/SetPrototype.cpp
435
    runtime/SimpleTypedArrayController.cpp
436
    runtime/SmallStrings.cpp
437
    runtime/SparseArrayValueMap.cpp
438
    runtime/StrictEvalActivation.cpp
439 440 441
    runtime/StringConstructor.cpp
    runtime/StringObject.cpp
    runtime/StringPrototype.cpp
442
    runtime/StringRecursionChecker.cpp
443 444
    runtime/Structure.cpp
    runtime/StructureChain.cpp
445
    runtime/StructureRareData.cpp
446
    runtime/SymbolTable.cpp
447
    runtime/TestRunnerUtils.cpp
448 449
    runtime/TypedArrayController.cpp
    runtime/TypedArrayType.cpp
450
    runtime/VM.cpp
451
    runtime/VMEntryScope.cpp
452 453
    runtime/Watchdog.cpp
    runtime/WatchdogNone.cpp
oliver@apple.com's avatar
oliver@apple.com committed
454 455 456
    runtime/WeakMapConstructor.cpp
    runtime/WeakMapData.cpp
    runtime/WeakMapPrototype.cpp
457

458 459 460
    tools/CodeProfile.cpp
    tools/CodeProfiling.cpp

461
    yarr/YarrCanonicalizeUCS2.cpp
462 463
    yarr/YarrInterpreter.cpp
    yarr/YarrJIT.cpp
464
    yarr/YarrPattern.cpp
465
    yarr/YarrSyntaxChecker.cpp
466 467
)

468
set(JavaScriptCore_LUT_FILES
469
    runtime/ArrayConstructor.cpp
470
    runtime/ArrayPrototype.cpp
471 472
    runtime/BooleanPrototype.cpp
    runtime/DateConstructor.cpp
473
    runtime/DatePrototype.cpp
474
    runtime/ErrorPrototype.cpp
475
    runtime/JSDataViewPrototype.cpp
476
    runtime/JSGlobalObject.cpp
477
    runtime/JSONObject.cpp
weinig@apple.com's avatar
weinig@apple.com committed
478 479
    runtime/JSPromiseConstructor.cpp
    runtime/JSPromisePrototype.cpp
480
    runtime/NamePrototype.cpp
481
    runtime/NumberConstructor.cpp
482
    runtime/NumberPrototype.cpp
barraclough@apple.com's avatar
barraclough@apple.com committed
483
    runtime/ObjectConstructor.cpp
484 485
    runtime/RegExpConstructor.cpp
    runtime/RegExpObject.cpp
486 487
    runtime/RegExpPrototype.cpp
    runtime/StringConstructor.cpp
488 489
)

490
set(JavaScriptCore_LIBRARIES
491
    WTF
492 493
)

494 495 496 497 498 499 500 501 502
if (WTF_USE_ICU_UNICODE)
    list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
        ${ICU_INCLUDE_DIRS}
    )
    list(APPEND JavaScriptCore_LIBRARIES
        ${ICU_I18N_LIBRARIES}
    )
endif ()

503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532
if (WTF_USE_UDIS86)
    set(UDIS_GEN_DEP
        disassembler/udis86/ud_opcode.py
        disassembler/udis86/ud_optable.py
    )

    add_custom_command(
        OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.c ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
        DEPENDS ${UDIS_GEN_DEP}
        WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
        COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/disassembler/udis86/itab.py ${JAVASCRIPTCORE_DIR}/disassembler/udis86/optable.xml
        VERBATIM)

    list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
        ${JAVASCRIPTCORE_DIR}/disassembler/udis86
    )
    list(APPEND JavaScriptCore_HEADERS
        ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
    )
    list(APPEND JavaScriptCore_SOURCES
        disassembler/udis86/udis86.c
        disassembler/udis86/udis86_decode.c
        disassembler/udis86/udis86_input.c
        disassembler/udis86/udis86_itab_holder.c
        disassembler/udis86/udis86_syn-att.c
        disassembler/udis86/udis86_syn-intel.c
        disassembler/udis86/udis86_syn.c
    )
endif ()

533
if (ENABLE_LLINT)
534 535 536
    # We cannot check for RUBY_FOUND because it is set only when the full package is installed and
    # the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro
    # for finding the only Ruby interpreter.
537 538 539
    if (NOT RUBY_EXECUTABLE)
        message(FATAL_ERROR "The Ruby interpreter is needed to generate LLInt files.")
    endif ()
540

541
    set(LLINT_ASM
542 543 544 545 546
        llint/LowLevelInterpreter.asm
        llint/LowLevelInterpreter32_64.asm
        llint/LowLevelInterpreter64.asm
    )

547
    set(OFFLINE_ASM
548
        offlineasm/arm.rb
549 550 551 552 553 554 555 556 557
        offlineasm/ast.rb
        offlineasm/backends.rb
        offlineasm/cloop.rb
        offlineasm/config.rb
        offlineasm/instructions.rb
        offlineasm/offsets.rb
        offlineasm/opt.rb
        offlineasm/parser.rb
        offlineasm/registers.rb
558
        offlineasm/risc.rb
559 560 561 562 563 564
        offlineasm/self_hash.rb
        offlineasm/settings.rb
        offlineasm/transform.rb
        offlineasm/x86.rb
    )

565
    add_custom_command(
566 567 568 569 570 571
        OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
        MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb
        DEPENDS ${LLINT_ASM} ${OFFLINE_ASM}
        COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
        VERBATIM)

572 573 574 575 576 577 578 579 580
    # We add the header file directly to the ADD_EXECUTABLE call instead of setting the
    # OBJECT_DEPENDS property in LLIntOffsetsExtractor.cpp because generate_offset_extractor.rb may
    # not regenerate it in case the hash it calculates does not change.
    # In this case, if some of the dependencies specified in the ADD_CUSTOM_COMMAND above have
    # changed the command will always be called because the mtime of LLIntDesiredOffsets.h will
    # always be older than that of its dependencies.
    # Additionally, setting the OBJECT_DEPENDS property will make LLIntDesiredOffsets.h a Makefile
    # dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will
    # actually be run twice!
581
    add_executable(LLIntOffsetsExtractor
582 583 584
        ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
        ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
    )
585
    target_link_libraries(LLIntOffsetsExtractor WTF)
586

587 588 589 590 591 592
    # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than
    # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization
    # that generates a checksum of the LLIntOffsetsExtractor binary, if the checksum of the new
    # LLIntOffsetsExtractor matches, no output is generated. To make this target consistent and avoid
    # running this command for every build, we artificially update LLIntAssembly.h's mtime (using touch)
    # after every asm.rb run.
593
    add_custom_command(
594 595 596 597
        OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
        MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb
        DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM}
        COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
598
        COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
599 600
        VERBATIM)

601 602 603
    # The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of
    # the .cpp files below is similar to the one in the previous comment. However, since these .cpp
    # files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS
604 605
    # since it is used in the add_library() call at the end of this file.
    list(APPEND JavaScriptCore_HEADERS
606 607
        ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
    )
608
    list(APPEND JavaScriptCore_SOURCES
609 610
        llint/LLIntCLoop.cpp
        llint/LLIntData.cpp
611
        llint/LLIntEntrypoint.cpp
612 613 614 615 616
        llint/LLIntExceptions.cpp
        llint/LLIntSlowPaths.cpp
        llint/LLIntThunks.cpp
        llint/LowLevelInterpreter.cpp
    )
617
endif ()
618

619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693
if (ENABLE_FTL_JIT)
    if (NOT LLVM_STATIC_LIBRARIES)
        message(FATAL_ERROR "No LLVM libs found, but FTL is enabled. Stopping build.")
    endif ()

    # Configure llvmForJSC.so
    set(llvmForJSC_SOURCES
        llvm/library/LLVMAnchor.cpp
        llvm/library/LLVMExports.cpp
        llvm/library/LLVMOverrides.cpp
    )
    set(llvmForJSC_INCLUDE_DIRECTORIES
        ${LLVM_INCLUDE_DIRS}
        "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
    )

    add_custom_command(
        OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h
        DEPENDS ${LLVM_STATIC_LIBRARIES}
        COMMAND ${CMAKE_COMMAND} -E touch ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h
        VERBATIM)

    WEBKIT_WRAP_SOURCELIST(${llvmForJSC_SOURCES})
    add_library(llvmForJSC SHARED ${llvmForJSC_SOURCES} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h)
    target_link_libraries(llvmForJSC ${LLVM_STATIC_LIBRARIES} "pthread" "dl")

    # Added extra items for JavaScriptCore
    list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
        ${LLVM_INCLUDE_DIRS}
    )

    list(APPEND JavaScriptCore_SOURCES
        llvm/InitializeLLVM.cpp
        llvm/InitializeLLVMPOSIX.cpp
        llvm/InitializeLLVMLinux.cpp
        llvm/LLVMAPI.cpp

        dfg/DFGToFTLDeferredCompilationCallback.cpp
        dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp

        disassembler/LLVMDisassembler.cpp
        disassembler/X86Disassembler.cpp

        ftl/FTLAbstractHeap.cpp
        ftl/FTLAbstractHeapRepository.cpp
        ftl/FTLCapabilities.cpp
        ftl/FTLCommonValues.cpp
        ftl/FTLCompile.cpp
        ftl/FTLExitArgument.cpp
        ftl/FTLExitArgumentForOperand.cpp
        ftl/FTLExitThunkGenerator.cpp
        ftl/FTLExitValue.cpp
        ftl/FTLFail.cpp
        ftl/FTLForOSREntryJITCode.cpp
        ftl/FTLInlineCacheSize.cpp
        ftl/FTLIntrinsicRepository.cpp
        ftl/FTLJITCode.cpp
        ftl/FTLJITFinalizer.cpp
        ftl/FTLLink.cpp
        ftl/FTLLocation.cpp
        ftl/FTLLowerDFGToLLVM.cpp
        ftl/FTLOSREntry.cpp
        ftl/FTLOSRExit.cpp
        ftl/FTLOSRExitCompiler.cpp
        ftl/FTLOutput.cpp
        ftl/FTLSaveRestore.cpp
        ftl/FTLSlowPathCall.cpp
        ftl/FTLSlowPathCallKey.cpp
        ftl/FTLStackMaps.cpp
        ftl/FTLState.cpp
        ftl/FTLThunks.cpp
        ftl/FTLValueFormat.cpp
    )
endif ()

694 695 696 697 698 699 700 701 702 703
set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table)
macro(GENERATE_HASH_LUT _input _output)
    add_custom_command(
        OUTPUT ${_output}
        DEPENDS ${HASH_LUT_GENERATOR} ${_input}
        COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} -i > ${_output}
        VERBATIM)
    list(APPEND JavaScriptCore_HEADERS ${_output})
endmacro()

704
# GENERATOR 1-A: LUT creator
705 706
foreach (_file ${JavaScriptCore_LUT_FILES})
    get_filename_component(_name ${_file} NAME_WE)
707
    GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
708
endforeach ()
709

710
set(JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES
711
    assembler
712
    bindings
713 714 715
    bytecode
    debugger
    heap
716
    inspector
717
    inspector/agents
718 719 720 721 722 723 724
    interpreter
    jit
    llint
    parser
    profiler
    runtime
    yarr
725 726

    collector/handles
727 728
)

729
set(JavaScriptCore_FORWARDING_HEADERS_FILES
730 731 732
    API/APICast.h
    API/APIShims.h
    API/JSBase.h
733
    API/JSCTestRunnerUtils.h
734 735 736 737
    API/JSContextRef.h
    API/JSContextRefPrivate.h
    API/JSObjectRef.h
    API/JSObjectRefPrivate.h
738
    API/JSRetainPtr.h
739
    API/JSScriptRefPrivate.h
740 741
    API/JSStringRef.h
    API/JSStringRefBSTR.h
742
    API/JSStringRefCF.h
743 744 745
    API/JSValueRef.h
    API/JSWeakObjectMapRefInternal.h
    API/JSWeakObjectMapRefPrivate.h
746 747
    API/JavaScript.h
    API/JavaScriptCore.h
748 749
    API/OpaqueJSString.h
    API/WebKitAvailability.h
750 751 752 753 754 755

    assembler/LinkBuffer.h
    assembler/MacroAssembler.h
    assembler/MacroAssemblerCodeRef.h
    jit/GPRInfo.h
    runtime/VM.h
756 757
)

758 759

# GENERATOR 1-B: particular LUT creator (for 1 file only)
760
GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
761 762

#GENERATOR: "RegExpJitTables.h": tables used by Yarr
763
add_custom_command(
764
    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
765 766
    MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables
    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
767
    VERBATIM)
768
ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
769 770


771
#GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
772
add_custom_command(
773
    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
774 775
    MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py
    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
776
    VERBATIM)
777
ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
778

779 780 781 782 783 784

# Inspector Interfaces

set(JavaScriptCore_INSPECTOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")

set(JavaScriptCore_INSPECTOR_DOMAINS
785 786 787
    inspector/protocol/Debugger.json
    inspector/protocol/GenericTypes.json
    inspector/protocol/InspectorDomain.json
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817
    inspector/protocol/Runtime.json
)

add_custom_command(
    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json
    MAIN_DEPENDENCY ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-combined-inspector-json.py
    DEPENDS ${JavaScriptCore_INSPECTOR_DOMAINS}
    COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-combined-inspector-json.py ${JAVASCRIPTCORE_DIR}/inspector/protocol > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json
    VERBATIM)

# Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
add_custom_command(
    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendDispatchers.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendDispatchers.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSFrontendDispatchers.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSFrontendDispatchers.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.h
    MAIN_DEPENDENCY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json
    DEPENDS ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspectorStrings.py
    COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json --output_h_dir "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}" --output_cpp_dir "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}" --output_js_dir "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}" --output_type JavaScript --write_always && mkdir -p ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector && cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendDispatchers.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSFrontendDispatchers.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector
    VERBATIM)

list(APPEND JavaScriptCore_SOURCES
    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendDispatchers.cpp
    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSFrontendDispatchers.cpp
    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.cpp
)

list(APPEND JavaScriptCore_HEADERS
    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendDispatchers.h
    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSFrontendDispatchers.h
    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.h
)

818 819 820 821 822 823 824 825 826 827
add_custom_command(
    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
    MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js
    DEPENDS ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py
    COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py < ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
    COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl InjectedScriptSource_js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h
    VERBATIM)

list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h)

828

829 830
if (WTF_CPU_ARM)
    list(APPEND JavaScriptCore_SOURCES
831
        assembler/ARMAssembler.cpp
832
        assembler/ARMv7Assembler.cpp
833 834
        assembler/MacroAssemblerARM.cpp
    )
835 836 837 838
    if (MSVC AND ENABLE_JIT)
        add_custom_command(
            OUTPUT ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm
            MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_jit_stubs
839
            DEPENDS ${JAVASCRIPTCORE_DIR}/jit/JITStubsARM.h
840
            DEPENDS ${JAVASCRIPTCORE_DIR}/jit/JITStubs.cpp
841
            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
842 843 844 845 846 847 848 849 850 851
            VERBATIM)

        add_custom_command(
            OUTPUT ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj
            MAIN_DEPENDENCY ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm
            COMMAND armasm -nologo ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj
            VERBATIM)

        list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj)
    endif ()
852
elseif (WTF_CPU_MIPS)
853
elseif (WTF_CPU_SH4)
854
elseif (WTF_CPU_X86)
855 856 857
    list(APPEND JavaScriptCore_SOURCES
        assembler/MacroAssemblerX86Common.cpp
    )
858
elseif (WTF_CPU_X86_64)
859 860 861 862 863 864 865 866 867
    if (MSVC AND ENABLE_JIT)
        add_custom_command(
            OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj
            MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
            COMMAND ml64 -nologo -c -Fo ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
            VERBATIM)

        list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj)
    endif ()
868 869 870
    list(APPEND JavaScriptCore_SOURCES
        assembler/MacroAssemblerX86Common.cpp
    )
871 872 873
else ()
    message(FATAL_ERROR "Unknown CPU")
endif ()
874 875


876
WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
877

878 879
WEBKIT_CREATE_FORWARDING_HEADERS(JavaScriptCore DIRECTORIES ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES} FILES ${JavaScriptCore_FORWARDING_HEADERS_FILES})

880

881
add_subdirectory(shell)
882 883

WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
884
include_directories(${JavaScriptCore_INCLUDE_DIRECTORIES})
885
add_definitions(-DSTATICALLY_LINKED_WITH_WTF)
886 887
add_library(JavaScriptCore ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
target_link_libraries(JavaScriptCore ${JavaScriptCore_LIBRARIES})
888
set_target_properties(JavaScriptCore PROPERTIES COMPILE_DEFINITIONS "BUILDING_JavaScriptCore")
889 890 891 892 893 894
set_target_properties(JavaScriptCore PROPERTIES FOLDER "JavaScriptCore")
set_target_properties(JavaScriptCore PROPERTIES LINK_INTERFACE_LIBRARIES "")

if (JavaScriptCore_OUTPUT_NAME)
    set_target_properties(JavaScriptCore PROPERTIES OUTPUT_NAME ${JavaScriptCore_OUTPUT_NAME})
endif ()
895

896
if (${JavaScriptCore_LIBRARY_TYPE} STREQUAL "SHARED")
897 898
    POPULATE_LIBRARY_VERSION(JAVASCRIPTCORE)
    set_target_properties(JavaScriptCore PROPERTIES VERSION ${JAVASCRIPTCORE_VERSION} SOVERSION ${JAVASCRIPTCORE_VERSION_MAJOR})
899
    install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}")
900
endif ()
901 902 903 904

if (ENABLE_FTL_JIT)
    add_dependencies(JavaScriptCore llvmForJSC)
endif ()