[CMake] Make the removal of transitive library dependencies work with CMake < 2.8.7.
[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}/heap"
11     "${JAVASCRIPTCORE_DIR}/debugger"
12     "${JAVASCRIPTCORE_DIR}/interpreter"
13     "${JAVASCRIPTCORE_DIR}/jit"
14     "${JAVASCRIPTCORE_DIR}/llint"
15     "${JAVASCRIPTCORE_DIR}/parser"
16     "${JAVASCRIPTCORE_DIR}/profiler"
17     "${JAVASCRIPTCORE_DIR}/runtime"
18     "${JAVASCRIPTCORE_DIR}/tools"
19     "${JAVASCRIPTCORE_DIR}/yarr"
20     "${JAVASCRIPTCORE_DIR}/wtf"
21     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
22     "${CMAKE_SOURCE_DIR}/Source"
23 )
24
25 SET(JavaScriptCore_SOURCES
26     API/JSBase.cpp
27     API/JSCallbackConstructor.cpp
28     API/JSCallbackFunction.cpp
29     API/JSCallbackObject.cpp
30     API/JSClassRef.cpp
31     API/JSContextRef.cpp
32     API/JSObjectRef.cpp
33     API/JSProfilerPrivate.cpp
34     API/JSStringRef.cpp
35     API/JSValueRef.cpp
36     API/JSWeakObjectMapRefPrivate.cpp
37     API/OpaqueJSString.cpp
38
39     bytecode/CallLinkInfo.cpp
40     bytecode/CallLinkStatus.cpp
41     bytecode/CodeBlock.cpp
42     bytecode/DFGExitProfile.cpp
43     bytecode/ExecutionCounter.cpp
44     bytecode/GetByIdStatus.cpp
45     bytecode/JumpTable.cpp
46     bytecode/LazyOperandValueProfile.cpp
47     bytecode/MethodCallLinkInfo.cpp
48     bytecode/MethodCallLinkStatus.cpp
49     bytecode/MethodOfGettingAValueProfile.cpp
50     bytecode/Opcode.cpp
51     bytecode/PolymorphicPutByIdList.cpp
52     bytecode/PredictedType.cpp
53     bytecode/PutByIdStatus.cpp
54     bytecode/SamplingTool.cpp
55     bytecode/StructureStubInfo.cpp
56
57     bytecompiler/BytecodeGenerator.cpp
58     bytecompiler/NodesCodegen.cpp
59
60     dfg/DFGAbstractState.cpp
61     dfg/DFGArithNodeFlagsInferencePhase.cpp
62     dfg/DFGAssemblyHelpers.cpp
63     dfg/DFGByteCodeParser.cpp
64     dfg/DFGCapabilities.cpp
65     dfg/DFGCFAPhase.cpp
66     dfg/DFGCorrectableJumpPoint.cpp
67     dfg/DFGCSEPhase.cpp
68     dfg/DFGDriver.cpp
69     dfg/DFGGraph.cpp
70     dfg/DFGJITCompiler.cpp
71     dfg/DFGOSREntry.cpp
72     dfg/DFGOSRExit.cpp
73     dfg/DFGOSRExitCompiler.cpp
74     dfg/DFGOSRExitCompiler32_64.cpp
75     dfg/DFGOSRExitCompiler64.cpp
76     dfg/DFGOperations.cpp
77     dfg/DFGPhase.cpp
78     dfg/DFGPredictionPropagationPhase.cpp
79     dfg/DFGRepatch.cpp
80     dfg/DFGSpeculativeJIT.cpp
81     dfg/DFGSpeculativeJIT32_64.cpp
82     dfg/DFGSpeculativeJIT64.cpp
83     dfg/DFGThunks.cpp
84     dfg/DFGVirtualRegisterAllocationPhase.cpp
85
86     heap/CopiedSpace.cpp
87     heap/DFGCodeBlocks.cpp
88     heap/Heap.cpp
89     heap/HandleHeap.cpp
90     heap/HandleStack.cpp
91     heap/MachineStackMarker.cpp
92     heap/MarkedAllocator.cpp
93     heap/MarkedBlock.cpp
94     heap/MarkedSpace.cpp
95     heap/ConservativeRoots.cpp
96     heap/MarkStack.cpp
97
98     debugger/Debugger.cpp
99     debugger/DebuggerActivation.cpp
100     debugger/DebuggerCallFrame.cpp
101     
102     interpreter/AbstractPC.cpp
103     interpreter/CallFrame.cpp
104     interpreter/Interpreter.cpp
105     interpreter/RegisterFile.cpp
106
107     jit/ExecutableAllocator.cpp
108     jit/HostCallReturnValue.cpp
109     jit/JITArithmetic32_64.cpp
110     jit/JITArithmetic.cpp
111     jit/JITCall32_64.cpp
112     jit/JITCall.cpp
113     jit/JIT.cpp
114     jit/JITExceptions.cpp
115     jit/JITOpcodes32_64.cpp
116     jit/JITOpcodes.cpp
117     jit/JITPropertyAccess32_64.cpp
118     jit/JITPropertyAccess.cpp
119     jit/JITStubs.cpp
120     jit/ThunkGenerators.cpp
121
122     parser/Lexer.cpp
123     parser/Nodes.cpp
124     parser/Parser.cpp
125     parser/ParserArena.cpp
126     parser/SourceProviderCache.cpp
127
128     profiler/Profile.cpp
129     profiler/ProfileGenerator.cpp
130     profiler/ProfileNode.cpp
131     profiler/Profiler.cpp
132
133     runtime/ArgList.cpp
134     runtime/Arguments.cpp
135     runtime/ArrayConstructor.cpp
136     runtime/ArrayPrototype.cpp
137     runtime/BooleanConstructor.cpp
138     runtime/BooleanObject.cpp
139     runtime/BooleanPrototype.cpp
140     runtime/CallData.cpp
141     runtime/CommonIdentifiers.cpp
142     runtime/Completion.cpp
143     runtime/ConstructData.cpp
144     runtime/DateConstructor.cpp
145     runtime/DateConversion.cpp
146     runtime/DateInstance.cpp
147     runtime/DatePrototype.cpp
148     runtime/Error.cpp
149     runtime/ErrorConstructor.cpp
150     runtime/ErrorInstance.cpp
151     runtime/ErrorPrototype.cpp
152     runtime/ExceptionHelpers.cpp
153     runtime/Executable.cpp
154     runtime/FunctionConstructor.cpp
155     runtime/FunctionPrototype.cpp
156     runtime/GCActivityCallback.cpp
157     runtime/GetterSetter.cpp
158     runtime/Identifier.cpp
159     runtime/InitializeThreading.cpp
160     runtime/InternalFunction.cpp
161     runtime/JSActivation.cpp
162     runtime/JSAPIValueWrapper.cpp
163     runtime/JSArray.cpp
164     runtime/JSByteArray.cpp
165     runtime/JSCell.cpp
166     runtime/JSDateMath.cpp
167     runtime/JSFunction.cpp
168     runtime/JSBoundFunction.cpp
169     runtime/JSGlobalData.cpp
170     runtime/JSGlobalObject.cpp
171     runtime/JSGlobalObjectFunctions.cpp
172     runtime/JSGlobalThis.cpp
173     runtime/JSLock.cpp
174     runtime/JSNotAnObject.cpp
175     runtime/JSObject.cpp
176     runtime/JSONObject.cpp
177     runtime/JSPropertyNameIterator.cpp
178     runtime/JSStaticScopeObject.cpp
179     runtime/JSString.cpp
180     runtime/JSValue.cpp
181     runtime/JSVariableObject.cpp
182     runtime/JSWrapperObject.cpp
183     runtime/LiteralParser.cpp
184     runtime/Lookup.cpp
185     runtime/MathObject.cpp
186     runtime/NativeErrorConstructor.cpp
187     runtime/NativeErrorPrototype.cpp
188     runtime/NumberConstructor.cpp
189     runtime/NumberObject.cpp
190     runtime/NumberPrototype.cpp
191     runtime/ObjectConstructor.cpp
192     runtime/ObjectPrototype.cpp
193     runtime/Operations.cpp
194     runtime/Options.cpp
195     runtime/PropertyDescriptor.cpp
196     runtime/PropertyNameArray.cpp
197     runtime/PropertySlot.cpp
198     runtime/RegExp.cpp
199     runtime/RegExpCache.cpp
200     runtime/RegExpConstructor.cpp
201     runtime/RegExpObject.cpp
202     runtime/RegExpPrototype.cpp
203     runtime/ScopeChain.cpp
204     runtime/SmallStrings.cpp
205     runtime/StrictEvalActivation.cpp
206     runtime/StringConstructor.cpp
207     runtime/StringObject.cpp
208     runtime/StringPrototype.cpp
209     runtime/StringRecursionChecker.cpp
210     runtime/Structure.cpp
211     runtime/StructureChain.cpp
212     runtime/TimeoutChecker.cpp
213     runtime/UString.cpp
214
215     tools/CodeProfile.cpp
216     tools/CodeProfiling.cpp
217
218     yarr/YarrPattern.cpp
219     yarr/YarrInterpreter.cpp
220     yarr/YarrJIT.cpp
221     yarr/YarrSyntaxChecker.cpp
222 )
223
224 SET(JavaScriptCore_LUT_FILES
225     runtime/ArrayConstructor.cpp
226     runtime/ArrayPrototype.cpp
227     runtime/BooleanPrototype.cpp
228     runtime/DateConstructor.cpp
229     runtime/DatePrototype.cpp
230     runtime/ErrorPrototype.cpp
231     runtime/JSGlobalObject.cpp
232     runtime/JSONObject.cpp
233     runtime/MathObject.cpp
234     runtime/NumberConstructor.cpp
235     runtime/NumberPrototype.cpp
236     runtime/ObjectConstructor.cpp
237     runtime/ObjectPrototype.cpp
238     runtime/RegExpConstructor.cpp
239     runtime/RegExpObject.cpp
240     runtime/RegExpPrototype.cpp
241     runtime/StringConstructor.cpp
242     runtime/StringPrototype.cpp
243 )
244
245 SET(JavaScriptCore_LIBRARIES
246     ${WTF_LIBRARY_NAME}
247 )
248
249
250 # GENERATOR 1-A: LUT creator
251 FOREACH (_file ${JavaScriptCore_LUT_FILES})
252     GET_FILENAME_COMPONENT(_name ${_file} NAME_WE)
253     GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
254     LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
255 ENDFOREACH ()
256
257
258 # GENERATOR 1-B: particular LUT creator (for 1 file only)
259 GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h MAIN_DEPENDENCY)
260 LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
261
262 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
263 ADD_CUSTOM_COMMAND(
264     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
265     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_regex_tables
266     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
267     VERBATIM)
268 ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
269
270
271 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
272 ADD_CUSTOM_COMMAND(
273     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
274     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/KeywordLookupGenerator.py
275     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/KeywordLookupGenerator.py ${JAVASCRIPTCORE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
276     VERBATIM)
277 ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
278
279 IF (WTF_CPU_ARM)
280     LIST(APPEND JavaScriptCore_SOURCES
281         assembler/ARMAssembler.cpp
282         assembler/ARMv7Assembler.cpp
283         assembler/MacroAssemblerARM.cpp
284     )
285 ELSEIF (WTF_CPU_MIPS)
286 ELSEIF (WTF_CPU_X86)
287 ELSEIF (WTF_CPU_X86_64)
288 ELSE ()
289     MESSAGE(FATAL_ERROR "Unknown CPU")
290 ENDIF ()
291
292
293 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
294
295
296 ADD_SUBDIRECTORY(wtf)
297 ADD_SUBDIRECTORY(shell)
298
299 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
300 INCLUDE_DIRECTORIES(${JavaScriptCore_INCLUDE_DIRECTORIES})
301 ADD_DEFINITIONS(-DBUILDING_JavaScriptCore)
302 ADD_LIBRARY(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
303 TARGET_LINK_LIBRARIES(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARIES})
304 SET_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "")
305
306 IF (JavaScriptCore_LINK_FLAGS)
307     ADD_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} LINK_FLAGS "${JavaScriptCore_LINK_FLAGS}")
308 ENDIF ()
309
310 IF (SHARED_CORE)
311     SET_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
312     INSTALL(TARGETS ${JavaScriptCore_LIBRARY_NAME} DESTINATION "${LIB_INSTALL_DIR}")
313 ENDIF ()