[CMake] Do not build bmalloc when USE_SYSTEM_MALLOC is ON
[WebKit-https.git] / Source / WTF / wtf / CMakeLists.txt
1 set(WTF_HEADERS
2     ASCIICType.h
3     Assertions.h
4     Atomics.h
5     Bag.h
6     BagToHashMap.h
7     BitVector.h
8     Bitmap.h
9     BubbleSort.h
10     BumpArena.h
11     BumpPointerAllocator.h
12     ByteOrder.h
13     CompilationThread.h
14     Compiler.h
15     Condition.h
16     CryptographicUtilities.h
17     CryptographicallyRandomNumber.h
18     CurrentTime.h
19     DataLog.h
20     DateMath.h
21     Dominators.h
22     DecimalNumber.h
23     DeferrableRefCounted.h
24     Deque.h
25     DisallowCType.h
26     DoublyLinkedList.h
27     FastMalloc.h
28     FeatureDefines.h
29     FilePrintStream.h
30     FlipBytes.h
31     Forward.h
32     FunctionDispatcher.h
33     Functional.h
34     GetPtr.h
35     GraphNodeWorklist.h
36     GregorianDateTime.h
37     HashCountedSet.h
38     Hasher.h
39     HashFunctions.h
40     HashIterators.h
41     HashMap.h
42     HashMethod.h
43     HashSet.h
44     HashTable.h
45     HashTraits.h
46     HexNumber.h
47     IteratorAdaptors.h
48     IteratorRange.h
49     ListHashSet.h
50     Lock.h
51     Locker.h
52     MD5.h
53     MainThread.h
54     MallocPtr.h
55     MathExtras.h
56     MediaTime.h
57     MessageQueue.h
58     MetaAllocator.h
59     MetaAllocatorHandle.h
60     Noncopyable.h
61     NumberOfCores.h
62     OSAllocator.h
63     OSRandomSource.h
64     PageAllocation.h
65     PageBlock.h
66     PageReservation.h
67     ParallelHelperPool.h
68     ParallelJobs.h
69     ParallelJobsGeneric.h
70     ParallelJobsLibdispatch.h
71     ParallelJobsOpenMP.h
72     ParallelVectorIterator.h
73     ParkingLot.h
74     PassRefPtr.h
75     Platform.h
76     PrintStream.h
77     ProcessID.h
78     RAMSize.h
79     RandomNumber.h
80     RandomNumberSeed.h
81     RawPointer.h
82     RedBlackTree.h
83     Ref.h
84     RefCounted.h
85     RefCountedLeakCounter.h
86     RefCounter.h
87     RefPtr.h
88     RetainPtr.h
89     RunLoop.h
90     SHA1.h
91     SharedTask.h
92     SaturatedArithmetic.h
93     ScopedLambda.h
94     SegmentedVector.h
95     StackBounds.h
96     StackStats.h
97     StaticConstructors.h
98     StdLibExtras.h
99     Stopwatch.h
100     StringExtras.h
101     StringPrintStream.h
102     SystemTracing.h
103     ThreadIdentifierDataPthreads.h
104     ThreadSafeRefCounted.h
105     ThreadSpecific.h
106     Threading.h
107     ThreadingPrimitives.h
108     TinyPtrSet.h
109     VMTags.h
110     ValueCheck.h
111     Vector.h
112     VectorTraits.h
113     WTFThreadData.h
114     WeakPtr.h
115     WordLock.h
116     WorkQueue.h
117     dtoa.h
118
119     dtoa/bignum-dtoa.h
120     dtoa/bignum.h
121     dtoa/cached-powers.h
122     dtoa/diy-fp.h
123     dtoa/double-conversion.h
124     dtoa/double.h
125     dtoa/fast-dtoa.h
126     dtoa/fixed-dtoa.h
127     dtoa/strtod.h
128     dtoa/utils.h
129
130     text/AtomicString.h
131     text/AtomicStringImpl.h
132     text/AtomicStringTable.h
133     text/Base64.h
134     text/CString.h
135     text/IntegerToStringConversion.h
136     text/LChar.h
137     text/StringBuffer.h
138     text/StringCommon.h
139     text/StringHash.h
140     text/StringImpl.h
141     text/StringView.h
142     text/SymbolImpl.h
143     text/SymbolRegistry.h
144     text/UniquedStringImpl.h
145     text/WTFString.h
146
147     threads/BinarySemaphore.h
148
149     unicode/CharacterNames.h
150     unicode/Collator.h
151     unicode/UTF8.h
152 )
153
154 set(WTF_SOURCES
155     Assertions.cpp
156     Atomics.cpp
157     BitVector.cpp
158     BumpArena.cpp
159     CompilationThread.cpp
160     CryptographicUtilities.cpp
161     CryptographicallyRandomNumber.cpp
162     CurrentTime.cpp
163     DataLog.cpp
164     DateMath.cpp
165     DecimalNumber.cpp
166     FastBitVector.cpp
167     FastMalloc.cpp
168     FilePrintStream.cpp
169     FunctionDispatcher.cpp
170     GregorianDateTime.cpp
171     HashTable.cpp
172     Lock.cpp
173     MD5.cpp
174     MainThread.cpp
175     MediaTime.cpp
176     MetaAllocator.cpp
177     NumberOfCores.cpp
178     OSRandomSource.cpp
179     PageBlock.cpp
180     ParallelHelperPool.cpp
181     ParallelJobsGeneric.cpp
182     ParkingLot.cpp
183     PrintStream.cpp
184     RAMSize.cpp
185     RandomNumber.cpp
186     RefCountedLeakCounter.cpp
187     RefCounter.cpp
188     RunLoop.cpp
189     SHA1.cpp
190     SixCharacterHash.cpp
191     StackBounds.cpp
192     StackStats.cpp
193     StringPrintStream.cpp
194     Threading.cpp
195     WTFThreadData.cpp
196     WordLock.cpp
197     WorkQueue.cpp
198     dtoa.cpp
199
200     dtoa/bignum-dtoa.cc
201     dtoa/bignum.cc
202     dtoa/cached-powers.cc
203     dtoa/diy-fp.cc
204     dtoa/double-conversion.cc
205     dtoa/fast-dtoa.cc
206     dtoa/fixed-dtoa.cc
207     dtoa/strtod.cc
208
209     text/AtomicString.cpp
210     text/AtomicStringImpl.cpp
211     text/AtomicStringTable.cpp
212     text/Base64.cpp
213     text/CString.cpp
214     text/StringBuilder.cpp
215     text/StringImpl.cpp
216     text/StringStatics.cpp
217     text/StringView.cpp
218     text/SymbolRegistry.cpp
219     text/WTFString.cpp
220
221     threads/BinarySemaphore.cpp
222
223     unicode/UTF8.cpp
224 )
225
226 set(WTF_INCLUDE_DIRECTORIES
227     "${BMALLOC_DIR}"
228     "${WTF_DIR}"
229     "${WTF_DIR}/wtf"
230     "${WTF_DIR}/wtf/dtoa"
231     "${WTF_DIR}/wtf/text"
232     "${WTF_DIR}/wtf/threads"
233     "${WTF_DIR}/wtf/unicode"
234     "${THIRDPARTY_DIR}"
235     "${CMAKE_BINARY_DIR}"
236     "${DERIVED_SOURCES_DIR}"
237 )
238
239 set(WTF_LIBRARIES
240     ${CMAKE_DL_LIBS}
241 )
242
243 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
244     list(APPEND WTF_HEADERS
245         spi/darwin/CommonCryptoSPI.h
246     )
247     list(APPEND WTF_INCLUDE_DIRECTORIES
248         "${WTF_DIR}/wtf/spi/darwin"
249     )
250 endif ()
251
252 if (NOT USE_SYSTEM_MALLOC)
253     list(APPEND WTF_LIBRARIES bmalloc)
254 endif ()
255
256 list(APPEND WTF_SOURCES
257     unicode/icu/CollatorICU.cpp
258 )
259 set(WTF_SYSTEM_INCLUDE_DIRECTORIES
260     ${ICU_INCLUDE_DIRS}
261 )
262 list(APPEND WTF_LIBRARIES
263     ${ICU_I18N_LIBRARIES}
264     ${ICU_LIBRARIES}
265 )
266
267 if (WIN32)
268     list(APPEND WTF_SOURCES
269         OSAllocatorWin.cpp
270         ThreadSpecificWin.cpp
271         ThreadingWin.cpp
272     )
273 else ()
274     list(APPEND WTF_HEADERS
275         ThreadIdentifierDataPthreads.h
276     )
277     list(APPEND WTF_SOURCES
278         OSAllocatorPosix.cpp
279         ThreadIdentifierDataPthreads.cpp
280         ThreadingPthreads.cpp
281     )
282 endif ()
283
284 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
285
286 WEBKIT_WRAP_SOURCELIST(${WTF_SOURCES})
287 include_directories(${WTF_INCLUDE_DIRECTORIES})
288 include_directories(SYSTEM ${WTF_SYSTEM_INCLUDE_DIRECTORIES})
289 add_library(WTF ${WTF_LIBRARY_TYPE} ${WTF_HEADERS} ${WTF_SOURCES})
290 target_link_libraries(WTF ${WTF_LIBRARIES})
291 set_target_properties(WTF PROPERTIES COMPILE_DEFINITIONS "BUILDING_WTF")
292 set_target_properties(WTF PROPERTIES FOLDER "JavaScriptCore")
293
294 if (MSVC)
295     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
296     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
297 endif ()
298
299 if (WTF_POST_BUILD_COMMAND)
300     add_custom_command(TARGET WTF POST_BUILD COMMAND ${WTF_POST_BUILD_COMMAND} VERBATIM)
301 endif ()
302
303 if (WTF_OUTPUT_NAME)
304     set_target_properties(WTF PROPERTIES OUTPUT_NAME ${WTF_OUTPUT_NAME})
305 endif ()
306
307 WEBKIT_FRAMEWORK(WTF)