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