Fix std::make_unique / new[] using system malloc
[WebKit-https.git] / Source / WTF / wtf / CMakeLists.txt
1 set(WTF_HEADERS
2     ASCIICType.h
3     Algorithms.h
4     Assertions.h
5     Atomics.h
6     AutodrainedPool.h
7     AutomaticThread.h
8     BackwardsGraph.h
9     Bag.h
10     BagToHashMap.h
11     BitVector.h
12     Bitmap.h
13     BlockObjCExceptions.h
14     BlockPtr.h
15     BlockStack.h
16     BloomFilter.h
17     Box.h
18     Brigand.h
19     BubbleSort.h
20     BumpPointerAllocator.h
21     ByteOrder.h
22     CPUTime.h
23     CagedPtr.h
24     CagedUniquePtr.h
25     CallbackAggregator.h
26     CheckedArithmetic.h
27     CheckedBoolean.h
28     ClockType.h
29     CommaPrinter.h
30     CompilationThread.h
31     Compiler.h
32     CompletionHandler.h
33     ConcurrentBuffer.h
34     ConcurrentPtrHashSet.h
35     ConcurrentVector.h
36     Condition.h
37     CountingLock.h
38     CrossThreadCopier.h
39     CrossThreadQueue.h
40     CrossThreadTask.h
41     CrossThreadTaskHandler.h
42     CryptographicUtilities.h
43     CryptographicallyRandomNumber.h
44     DataLog.h
45     DateMath.h
46     DebugUtilities.h
47     DecimalNumber.h
48     DeferrableRefCounted.h
49     DeprecatedOptional.h
50     Deque.h
51     DisallowCType.h
52     DispatchPtr.h
53     Dominators.h
54     DoublyLinkedList.h
55     DumbPtrTraits.h
56     DumbValueTraits.h
57     EnumTraits.h
58     Expected.h
59     ExportMacros.h
60     FastBitVector.h
61     FastMalloc.h
62     FastTLS.h
63     FeatureDefines.h
64     FilePrintStream.h
65     FlipBytes.h
66     ForbidHeapAllocation.h
67     Forward.h
68     Function.h
69     FunctionDispatcher.h
70     GetPtr.h
71     Gigacage.h
72     GlobalVersion.h
73     GraphNodeWorklist.h
74     GregorianDateTime.h
75     HashCountedSet.h
76     HashFunctions.h
77     HashIterators.h
78     HashMap.h
79     HashMethod.h
80     HashSet.h
81     HashTable.h
82     HashTraits.h
83     Hasher.h
84     HexNumber.h
85     Identified.h
86     Indenter.h
87     IndexKeyType.h
88     IndexMap.h
89     IndexSet.h
90     IndexSparseSet.h
91     IndexedContainerIterator.h
92     InlineASM.h
93     Insertion.h
94     InstanceCounted.h
95     IsoMalloc.h
96     IsoMallocInlines.h
97     IteratorAdaptors.h
98     IteratorRange.h
99     JSONValues.h
100     JSValueMalloc.h
101     KeyValuePair.h
102     LEBDecoder.h
103     Language.h
104     ListDump.h
105     ListHashSet.h
106     Liveness.h
107     Lock.h
108     LockAlgorithm.h
109     LockAlgorithmInlines.h
110     LockedPrintStream.h
111     Locker.h
112     LocklessBag.h
113     Logger.h
114     LoggerHelper.h
115     LoggingAccumulator.h
116     LoggingHashID.h
117     LoggingHashMap.h
118     LoggingHashSet.h
119     LoggingHashTraits.h
120     MD5.h
121     MainThread.h
122     MallocPtr.h
123     MathExtras.h
124     MediaTime.h
125     MemoryFootprint.h
126     MemoryPressureHandler.h
127     MessageQueue.h
128     MetaAllocator.h
129     MetaAllocatorHandle.h
130     MonotonicTime.h
131     NakedPtr.h
132     NaturalLoops.h
133     NeverDestroyed.h
134     NoLock.h
135     NoTailCalls.h
136     Noncopyable.h
137     NotFound.h
138     NumberOfCores.h
139     OSAllocator.h
140     OSObjectPtr.h
141     OSRandomSource.h
142     ObjcRuntimeExtras.h
143     ObjectIdentifier.h
144     OptionSet.h
145     Optional.h
146     OrderMaker.h
147     PackedIntVector.h
148     PageAllocation.h
149     PageBlock.h
150     PageReservation.h
151     ParallelHelperPool.h
152     ParallelJobs.h
153     ParallelJobsGeneric.h
154     ParallelJobsLibdispatch.h
155     ParallelJobsOpenMP.h
156     ParallelVectorIterator.h
157     ParkingLot.h
158     Platform.h
159     PlatformRegisters.h
160     PointerComparison.h
161     PointerPreparations.h
162     Poisoned.h
163     PoisonedUniquePtr.h
164     PrintStream.h
165     PriorityQueue.h
166     ProcessID.h
167     RAMSize.h
168     RandomDevice.h
169     RandomNumber.h
170     RandomNumberSeed.h
171     Range.h
172     RangeSet.h
173     RawPointer.h
174     ReadWriteLock.h
175     RecursableLambda.h
176     RecursiveLockAdapter.h
177     RedBlackTree.h
178     Ref.h
179     RefCounted.h
180     RefCountedArray.h
181     RefCountedLeakCounter.h
182     RefCounter.h
183     RefPtr.h
184     RetainPtr.h
185     RunLoop.h
186     RunLoopTimer.h
187     SHA1.h
188     SaturatedArithmetic.h
189     SchedulePair.h
190     Scope.h
191     ScopedLambda.h
192     Seconds.h
193     SegmentedVector.h
194     SentinelLinkedList.h
195     SetForScope.h
196     SharedTask.h
197     SimpleStats.h
198     SingleRootGraph.h
199     SinglyLinkedList.h
200     SinglyLinkedListWithTail.h
201     SixCharacterHash.h
202     SmallPtrSet.h
203     SoftLinking.h
204     Spectrum.h
205     StackBounds.h
206     StackShot.h
207     StackShotProfiler.h
208     StackStats.h
209     StackTrace.h
210     StdLibExtras.h
211     Stopwatch.h
212     StreamBuffer.h
213     StringExtras.h
214     StringHashDumpContext.h
215     StringPrintStream.h
216     SynchronizedFixedQueue.h
217     SystemFree.h
218     SystemTracing.h
219     ThreadGroup.h
220     ThreadMessage.h
221     ThreadSafeRefCounted.h
222     ThreadSpecific.h
223     Threading.h
224     ThreadingPrimitives.h
225     TimeWithDynamicClockType.h
226     TimingScope.h
227     TinyLRUCache.h
228     TinyPtrSet.h
229     TriState.h
230     TypeCasts.h
231     UUID.h
232     Unexpected.h
233     UniStdExtras.h
234     UnionFind.h
235     UniqueArray.h
236     UniqueRef.h
237     UnsafePointer.h
238     VMTags.h
239     ValueCheck.h
240     Variant.h
241     Vector.h
242     VectorTraits.h
243     WallTime.h
244     WeakPtr.h
245     WeakRandom.h
246     WindowsExtras.h
247     WordLock.h
248     WorkQueue.h
249     dtoa.h
250
251     dtoa/bignum-dtoa.h
252     dtoa/bignum.h
253     dtoa/cached-powers.h
254     dtoa/diy-fp.h
255     dtoa/double-conversion.h
256     dtoa/double.h
257     dtoa/fast-dtoa.h
258     dtoa/fixed-dtoa.h
259     dtoa/strtod.h
260     dtoa/utils.h
261
262     persistence/PersistentCoder.h
263     persistence/PersistentCoders.h
264     persistence/PersistentDecoder.h
265     persistence/PersistentEncoder.h
266
267     text/ASCIIFastPath.h
268     text/AtomicString.h
269     text/AtomicStringHash.h
270     text/AtomicStringImpl.h
271     text/AtomicStringTable.h
272     text/Base64.h
273     text/CString.h
274     text/ConversionMode.h
275     text/IntegerToStringConversion.h
276     text/LChar.h
277     text/LineBreakIteratorPoolICU.h
278     text/LineEnding.h
279     text/NullTextBreakIterator.h
280     text/OrdinalNumber.h
281     text/StringBuffer.h
282     text/StringBuilder.h
283     text/StringCommon.h
284     text/StringConcatenate.h
285     text/StringConcatenateNumbers.h
286     text/StringHash.h
287     text/StringHasher.h
288     text/StringImpl.h
289     text/StringMalloc.h
290     text/StringOperators.h
291     text/StringVector.h
292     text/StringView.h
293     text/SymbolImpl.h
294     text/SymbolRegistry.h
295     text/TextBreakIterator.h
296     text/TextBreakIteratorInternalICU.h
297     text/TextPosition.h
298     text/TextStream.h
299     text/UniquedStringImpl.h
300     text/ValueToString.h
301     text/WTFString.h
302
303     text/icu/TextBreakIteratorICU.h
304     text/icu/UTextProvider.h
305     text/icu/UTextProviderLatin1.h
306     text/icu/UTextProviderUTF16.h
307
308     threads/BinarySemaphore.h
309     threads/Signals.h
310
311     unicode/CharacterNames.h
312     unicode/Collator.h
313     unicode/UTF8.h
314 )
315
316 set(WTF_SOURCES
317     Assertions.cpp
318     Atomics.cpp
319     AutomaticThread.cpp
320     BitVector.cpp
321     CPUTime.cpp
322     ClockType.cpp
323     CompilationThread.cpp
324     ConcurrentPtrHashSet.cpp
325     CountingLock.cpp
326     CrossThreadCopier.cpp
327     CrossThreadTaskHandler.cpp
328     CryptographicUtilities.cpp
329     CryptographicallyRandomNumber.cpp
330     CurrentTime.cpp
331     DataLog.cpp
332     DateMath.cpp
333     DecimalNumber.cpp
334     FastBitVector.cpp
335     FastMalloc.cpp
336     FilePrintStream.cpp
337     FunctionDispatcher.cpp
338     Gigacage.cpp
339     GlobalVersion.cpp
340     GregorianDateTime.cpp
341     HashTable.cpp
342     JSONValues.cpp
343     JSValueMalloc.cpp
344     Language.cpp
345     Lock.cpp
346     LockedPrintStream.cpp
347     MD5.cpp
348     MainThread.cpp
349     MediaTime.cpp
350     MemoryPressureHandler.cpp
351     MetaAllocator.cpp
352     MonotonicTime.cpp
353     NumberOfCores.cpp
354     OSRandomSource.cpp
355     PageBlock.cpp
356     ParallelHelperPool.cpp
357     ParallelJobsGeneric.cpp
358     ParkingLot.cpp
359     Poisoned.cpp
360     PrintStream.cpp
361     RAMSize.cpp
362     RandomDevice.cpp
363     RandomNumber.cpp
364     ReadWriteLock.cpp
365     RefCountedLeakCounter.cpp
366     RunLoop.cpp
367     SHA1.cpp
368     Seconds.cpp
369     SixCharacterHash.cpp
370     StackBounds.cpp
371     StackStats.cpp
372     StackTrace.cpp
373     StringPrintStream.cpp
374     ThreadGroup.cpp
375     ThreadMessage.cpp
376     Threading.cpp
377     TimeWithDynamicClockType.cpp
378     TimingScope.cpp
379     UUID.cpp
380     WTFAssertions.cpp
381     WallTime.cpp
382     WordLock.cpp
383     WorkQueue.cpp
384     dtoa.cpp
385
386     dtoa/bignum-dtoa.cc
387     dtoa/bignum.cc
388     dtoa/cached-powers.cc
389     dtoa/diy-fp.cc
390     dtoa/double-conversion.cc
391     dtoa/fast-dtoa.cc
392     dtoa/fixed-dtoa.cc
393     dtoa/strtod.cc
394
395     persistence/PersistentCoders.cpp
396     persistence/PersistentDecoder.cpp
397     persistence/PersistentEncoder.cpp
398
399     text/AtomicString.cpp
400     text/AtomicStringImpl.cpp
401     text/AtomicStringTable.cpp
402     text/Base64.cpp
403     text/CString.cpp
404     text/LineEnding.cpp
405     text/StringBuilder.cpp
406     text/StringBuilderJSON.cpp
407     text/StringImpl.cpp
408     text/StringMalloc.cpp
409     text/StringView.cpp
410     text/SymbolImpl.cpp
411     text/SymbolRegistry.cpp
412     text/TextBreakIterator.cpp
413     text/TextStream.cpp
414     text/WTFString.cpp
415
416     text/icu/UTextProvider.cpp
417     text/icu/UTextProviderLatin1.cpp
418     text/icu/UTextProviderUTF16.cpp
419
420     threads/BinarySemaphore.cpp
421     threads/Signals.cpp
422
423     unicode/UTF8.cpp
424 )
425
426 set(WTF_INCLUDE_DIRECTORIES
427     "${BMALLOC_DIR}"
428     "${CMAKE_BINARY_DIR}"
429     "${DERIVED_SOURCES_DIR}"
430     "${THIRDPARTY_DIR}"
431 )
432
433 set(WTF_PRIVATE_INCLUDE_DIRECTORIES
434     "${WTF_DIR}"
435     "${WTF_DIR}/wtf"
436     "${WTF_DIR}/wtf/dtoa"
437     "${WTF_DIR}/wtf/persistence"
438     "${WTF_DIR}/wtf/text"
439     "${WTF_DIR}/wtf/text/icu"
440     "${WTF_DIR}/wtf/threads"
441     "${WTF_DIR}/wtf/unicode"
442 )
443
444 set(WTF_LIBRARIES
445     ${CMAKE_DL_LIBS}
446 )
447
448 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
449     list(APPEND WTF_HEADERS
450         spi/darwin/CommonCryptoSPI.h
451     )
452 list(APPEND WTF_PRIVATE_INCLUDE_DIRECTORIES
453         "${WTF_DIR}/wtf/spi/darwin"
454     )
455 endif ()
456
457 if (NOT USE_SYSTEM_MALLOC)
458     list(APPEND WTF_LIBRARIES bmalloc)
459 endif ()
460
461 list(APPEND WTF_SOURCES
462     unicode/CollatorDefault.cpp
463
464     unicode/icu/CollatorICU.cpp
465 )
466 set(WTF_SYSTEM_INCLUDE_DIRECTORIES
467     ${ICU_INCLUDE_DIRS}
468 )
469 list(APPEND WTF_LIBRARIES
470     ${ICU_DATA_LIBRARIES}
471     ${ICU_I18N_LIBRARIES}
472     ${ICU_LIBRARIES}
473 )
474
475 if (WIN32)
476     list(APPEND WTF_SOURCES
477         OSAllocatorWin.cpp
478         ThreadSpecificWin.cpp
479         ThreadingWin.cpp
480     )
481     list(APPEND WTF_LIBRARIES
482         winmm
483     )
484 else ()
485     list(APPEND WTF_SOURCES
486         OSAllocatorPosix.cpp
487         ThreadingPthreads.cpp
488     )
489 endif ()
490
491 WEBKIT_FRAMEWORK_DECLARE(WTF)
492 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
493
494 WEBKIT_WRAP_SOURCELIST(${WTF_SOURCES})
495 WEBKIT_FRAMEWORK(WTF)
496
497 WEBKIT_MAKE_FORWARDING_HEADERS(WTF
498     DESTINATION ${FORWARDING_HEADERS_DIR}/wtf
499     FILES ${WTF_HEADERS}
500 )
501
502 if (MSVC)
503     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
504     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
505
506     add_custom_command(
507         TARGET WTF
508         PRE_BUILD
509         COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/auto-version.pl ${DERIVED_SOURCES_DIR}
510         VERBATIM)
511
512     add_custom_command(
513         TARGET WTF
514         POST_BUILD
515         COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/version-stamp.pl ${DERIVED_SOURCES_DIR} $<TARGET_FILE:WTF>
516         VERBATIM)
517 endif ()
518
519 file(MAKE_DIRECTORY ${FORWARDING_HEADERS_DIR}/wtf/Scripts)
520
521 file(COPY
522     ../Scripts/generate-unified-source-bundles.rb
523     DESTINATION
524     ${FORWARDING_HEADERS_DIR}/wtf/Scripts
525 )