1SET(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}/heap" 10 "${JAVASCRIPTCORE_DIR}/debugger" 11 "${JAVASCRIPTCORE_DIR}/interpreter" 12 "${JAVASCRIPTCORE_DIR}/jit" 13 "${JAVASCRIPTCORE_DIR}/parser" 14 "${JAVASCRIPTCORE_DIR}/profiler" 15 "${JAVASCRIPTCORE_DIR}/runtime" 16 "${JAVASCRIPTCORE_DIR}/yarr" 17 "${WTF_INCLUDE_DIRECTORIES}" 18 "${CMAKE_SOURCE_DIR}" 19) 20 21SET(JavaScriptCore_SOURCES 22 API/JSBase.cpp 23 API/JSCallbackConstructor.cpp 24 API/JSCallbackFunction.cpp 25 API/JSCallbackObject.cpp 26 API/JSClassRef.cpp 27 API/JSContextRef.cpp 28 API/JSObjectRef.cpp 29 API/JSProfilerPrivate.cpp 30 API/JSStringRef.cpp 31 API/JSValueRef.cpp 32 API/JSWeakObjectMapRefPrivate.cpp 33 API/OpaqueJSString.cpp 34 35 bytecode/CodeBlock.cpp 36 bytecode/JumpTable.cpp 37 bytecode/Opcode.cpp 38 bytecode/SamplingTool.cpp 39 bytecode/StructureStubInfo.cpp 40 41 bytecompiler/BytecodeGenerator.cpp 42 bytecompiler/NodesCodegen.cpp 43 44 heap/Heap.cpp 45 heap/HandleHeap.cpp 46 heap/HandleStack.cpp 47 heap/MachineStackMarker.cpp 48 heap/MarkedBlock.cpp 49 heap/MarkedSpace.cpp 50 heap/ConservativeRoots.cpp 51 heap/MarkStack.cpp 52 53 debugger/Debugger.cpp 54 debugger/DebuggerActivation.cpp 55 debugger/DebuggerCallFrame.cpp 56 57 interpreter/CallFrame.cpp 58 interpreter/Interpreter.cpp 59 interpreter/RegisterFile.cpp 60 61 jit/ExecutableAllocator.cpp 62 jit/JITArithmetic32_64.cpp 63 jit/JITArithmetic.cpp 64 jit/JITCall32_64.cpp 65 jit/JITCall.cpp 66 jit/JIT.cpp 67 jit/JITOpcodes32_64.cpp 68 jit/JITOpcodes.cpp 69 jit/JITPropertyAccess32_64.cpp 70 jit/JITPropertyAccess.cpp 71 jit/JITStubs.cpp 72 jit/ThunkGenerators.cpp 73 74 parser/JSParser.cpp 75 parser/Lexer.cpp 76 parser/Nodes.cpp 77 parser/Parser.cpp 78 parser/ParserArena.cpp 79 parser/SourceProviderCache.cpp 80 81 profiler/Profile.cpp 82 profiler/ProfileGenerator.cpp 83 profiler/ProfileNode.cpp 84 profiler/Profiler.cpp 85 86 runtime/ArgList.cpp 87 runtime/Arguments.cpp 88 runtime/ArrayConstructor.cpp 89 runtime/ArrayPrototype.cpp 90 runtime/BooleanConstructor.cpp 91 runtime/BooleanObject.cpp 92 runtime/BooleanPrototype.cpp 93 runtime/CallData.cpp 94 runtime/CommonIdentifiers.cpp 95 runtime/Completion.cpp 96 runtime/ConstructData.cpp 97 runtime/DateConstructor.cpp 98 runtime/DateConversion.cpp 99 runtime/DateInstance.cpp 100 runtime/DatePrototype.cpp 101 runtime/Error.cpp 102 runtime/ErrorConstructor.cpp 103 runtime/ErrorInstance.cpp 104 runtime/ErrorPrototype.cpp 105 runtime/ExceptionHelpers.cpp 106 runtime/Executable.cpp 107 runtime/FunctionConstructor.cpp 108 runtime/FunctionPrototype.cpp 109 runtime/GCActivityCallback.cpp 110 runtime/GetterSetter.cpp 111 runtime/Identifier.cpp 112 runtime/InitializeThreading.cpp 113 runtime/InternalFunction.cpp 114 runtime/JSActivation.cpp 115 runtime/JSAPIValueWrapper.cpp 116 runtime/JSArray.cpp 117 runtime/JSByteArray.cpp 118 runtime/JSCell.cpp 119 runtime/JSFunction.cpp 120 runtime/JSGlobalData.cpp 121 runtime/JSGlobalObject.cpp 122 runtime/JSGlobalObjectFunctions.cpp 123 runtime/JSLock.cpp 124 runtime/JSNotAnObject.cpp 125 runtime/JSObject.cpp 126 runtime/JSObjectWithGlobalObject.cpp 127 runtime/JSONObject.cpp 128 runtime/JSPropertyNameIterator.cpp 129 runtime/JSStaticScopeObject.cpp 130 runtime/JSString.cpp 131 runtime/JSValue.cpp 132 runtime/JSVariableObject.cpp 133 runtime/JSWrapperObject.cpp 134 runtime/JSZombie.cpp 135 runtime/LiteralParser.cpp 136 runtime/Lookup.cpp 137 runtime/MathObject.cpp 138 runtime/NativeErrorConstructor.cpp 139 runtime/NativeErrorPrototype.cpp 140 runtime/NumberConstructor.cpp 141 runtime/NumberObject.cpp 142 runtime/NumberPrototype.cpp 143 runtime/ObjectConstructor.cpp 144 runtime/ObjectPrototype.cpp 145 runtime/Operations.cpp 146 runtime/PropertyDescriptor.cpp 147 runtime/PropertyNameArray.cpp 148 runtime/PropertySlot.cpp 149 runtime/RegExp.cpp 150 runtime/RegExpCache.cpp 151 runtime/RegExpConstructor.cpp 152 runtime/RegExpObject.cpp 153 runtime/RegExpPrototype.cpp 154 runtime/RopeImpl.cpp 155 runtime/ScopeChain.cpp 156 runtime/SmallStrings.cpp 157 runtime/StrictEvalActivation.cpp 158 runtime/StringConstructor.cpp 159 runtime/StringObject.cpp 160 runtime/StringPrototype.cpp 161 runtime/StringRecursionChecker.cpp 162 runtime/Structure.cpp 163 runtime/StructureChain.cpp 164 runtime/TimeoutChecker.cpp 165 runtime/UString.cpp 166 167 yarr/YarrPattern.cpp 168 yarr/YarrInterpreter.cpp 169 yarr/YarrJIT.cpp 170 yarr/YarrSyntaxChecker.cpp 171 172 wtf/DateMath.cpp 173 wtf/PageAllocationAligned.cpp 174 wtf/PageBlock.cpp 175) 176SET(JavaScriptCore_HEADERS ) 177 178SET(JavaScriptCore_LUT_FILES 179 runtime/ArrayPrototype.cpp 180 runtime/DatePrototype.cpp 181 runtime/JSONObject.cpp 182 runtime/MathObject.cpp 183 runtime/NumberConstructor.cpp 184 runtime/ObjectConstructor.cpp 185 runtime/RegExpConstructor.cpp 186 runtime/RegExpObject.cpp 187 runtime/StringPrototype.cpp 188) 189 190SET(JavaScriptCore_LIBRARIES 191 ${WTF_LIBRARY_NAME} 192) 193 194 195# GENERATOR 1-A: LUT creator 196FOREACH (_file ${JavaScriptCore_LUT_FILES}) 197 GET_FILENAME_COMPONENT(_name ${_file} NAME_WE) 198 GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h) 199 LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h) 200ENDFOREACH () 201 202 203# GENERATOR 1-B: particular LUT creator (for 1 file only) 204GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h MAIN_DEPENDENCY) 205LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h) 206 207#GENERATOR: "RegExpJitTables.h": tables used by Yarr 208ADD_CUSTOM_COMMAND( 209 OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h 210 MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_regex_tables 211 COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h 212 VERBATIM) 213ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h) 214 215 216 217IF (WTF_CPU_ARM) 218 LIST(APPEND JavaScriptCore_SOURCES 219 assembler/ARMAssembler.cpp 220 assembler/ARMv7Assembler.cpp 221 assembler/MacroAssemblerARM.cpp 222 ) 223ELSEIF (WTF_CPU_MIPS) 224ELSEIF (WTF_CPU_X86) 225ELSEIF (WTF_CPU_X86_64) 226ELSE () 227 MESSAGE(FATAL_ERROR "Unknown CPU") 228ENDIF () 229 230 231INCLUDE_IF_EXISTS(${JAVASCRIPTCORE_DIR}/CMakeLists${PORT}.txt) 232 233 234ADD_SUBDIRECTORY(wtf) 235ADD_SUBDIRECTORY(shell) 236 237WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES}) 238INCLUDE_DIRECTORIES(${JavaScriptCore_INCLUDE_DIRECTORIES}) 239ADD_DEFINITIONS(-DBUILDING_JavaScriptCore) 240ADD_LIBRARY(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES}) 241TARGET_LINK_LIBRARIES(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARIES}) 242 243IF (JavaScriptCore_LINK_FLAGS) 244 ADD_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} LINK_FLAGS "${JavaScriptCore_LINK_FLAGS}") 245ENDIF () 246 247IF (SHARED_CORE) 248 SET_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) 249 INSTALL(TARGETS ${JavaScriptCore_LIBRARY_NAME} DESTINATION lib) 250ENDIF () 251