JSC Xcode build should use unified sources for platform independent files
[WebKit-https.git] / Source / WTF / wtf / CMakeLists.txt
1 set(WTF_HEADERS
2     ASCIICType.h
3     Assertions.h
4     Atomics.h
5     AutomaticThread.h
6     BackwardsGraph.h
7     Bag.h
8     BagToHashMap.h
9     BitVector.h
10     Bitmap.h
11     Brigand.h
12     BubbleSort.h
13     BumpPointerAllocator.h
14     ByteOrder.h
15     CPUTime.h
16     CagedPtr.h
17     CagedUniquePtr.h
18     ClockType.h
19     CompilationThread.h
20     Compiler.h
21     Condition.h
22     CrossThreadCopier.h
23     CrossThreadTask.h
24     CryptographicUtilities.h
25     CryptographicallyRandomNumber.h
26     CurrentTime.h
27     DataLog.h
28     DateMath.h
29     Dominators.h
30     DecimalNumber.h
31     DeferrableRefCounted.h
32     Deque.h
33     DisallowCType.h
34     DoublyLinkedList.h
35     FastMalloc.h
36     FastTLS.h
37     FeatureDefines.h
38     FilePrintStream.h
39     FlipBytes.h
40     Forward.h
41     FunctionDispatcher.h
42     GetPtr.h
43     Gigacage.h
44     GlobalVersion.h
45     GraphNodeWorklist.h
46     GregorianDateTime.h
47     HashCountedSet.h
48     Hasher.h
49     HashFunctions.h
50     HashIterators.h
51     HashMap.h
52     HashMethod.h
53     HashSet.h
54     HashTable.h
55     HashTraits.h
56     HexNumber.h
57     IndexMap.h
58     IndexSet.h
59     IndexSparseSet.h
60     IndexedContainerIterator.h
61     IteratorAdaptors.h
62     IteratorRange.h
63     Language.h
64     ListHashSet.h
65     Liveness.h
66     Lock.h
67     LockAlgorithmInlines.h
68     LockAlgorithm.h
69     LockedPrintStream.h
70     Locker.h
71     LocklessBag.h
72     LoggingHashID.h
73     LoggingHashMap.h
74     LoggingHashSet.h
75     LoggingHashTraits.h
76     MD5.h
77     MainThread.h
78     MallocPtr.h
79     MathExtras.h
80     MediaTime.h
81     MemoryFootprint.h
82     MemoryPressureHandler.h
83     MessageQueue.h
84     MetaAllocator.h
85     MetaAllocatorHandle.h
86     NaturalLoops.h
87     MonotonicTime.h
88     Noncopyable.h
89     NumberOfCores.h
90     OSAllocator.h
91     OSRandomSource.h
92     OptionSet.h
93     OrderMaker.h
94     PageAllocation.h
95     PageBlock.h
96     PageReservation.h
97     ParallelHelperPool.h
98     ParallelJobs.h
99     ParallelJobsGeneric.h
100     ParallelJobsLibdispatch.h
101     ParallelJobsOpenMP.h
102     ParallelVectorIterator.h
103     ParkingLot.h
104     Platform.h
105     PlatformRegisters.h
106     PrintStream.h
107     ProcessID.h
108     RAMSize.h
109     RandomDevice.h
110     RandomNumber.h
111     RandomNumberSeed.h
112     Range.h
113     RangeSet.h
114     RawPointer.h
115     ReadWriteLock.h
116     RecursiveLockAdapter.h
117     RedBlackTree.h
118     Ref.h
119     RefCounted.h
120     RefCountedLeakCounter.h
121     RefCounter.h
122     RefPtr.h
123     RetainPtr.h
124     RunLoop.h
125     SHA1.h
126     SharedTask.h
127     SaturatedArithmetic.h
128     ScopedLambda.h
129     Seconds.h
130     SegmentedVector.h
131     SmallPtrSet.h
132     StackBounds.h
133     StackStats.h
134     StackTrace.h
135     StaticConstructors.h
136     StdLibExtras.h
137     Stopwatch.h
138     StringExtras.h
139     StringPrintStream.h
140     SystemFree.h
141     SystemTracing.h
142     ThreadGroup.h
143     ThreadMessage.h
144     ThreadSafeRefCounted.h
145     ThreadSpecific.h
146     Threading.h
147     ThreadingPrimitives.h
148     TimeWithDynamicClockType.h
149     TinyPtrSet.h
150     UUID.h
151     UniqueRef.h
152     VMTags.h
153     ValueCheck.h
154     Variant.h
155     Vector.h
156     VectorTraits.h
157     WallTime.h
158     WeakPtr.h
159     WordLock.h
160     WorkQueue.h
161     dtoa.h
162
163     dtoa/bignum-dtoa.h
164     dtoa/bignum.h
165     dtoa/cached-powers.h
166     dtoa/diy-fp.h
167     dtoa/double-conversion.h
168     dtoa/double.h
169     dtoa/fast-dtoa.h
170     dtoa/fixed-dtoa.h
171     dtoa/strtod.h
172     dtoa/utils.h
173
174     text/AtomicString.h
175     text/AtomicStringImpl.h
176     text/AtomicStringTable.h
177     text/Base64.h
178     text/CString.h
179     text/IntegerToStringConversion.h
180     text/LChar.h
181     text/LineBreakIteratorPoolICU.h
182     text/StringBuffer.h
183     text/StringCommon.h
184     text/StringHash.h
185     text/StringImpl.h
186     text/StringMalloc.h
187     text/StringVector.h
188     text/StringView.h
189     text/SymbolImpl.h
190     text/SymbolRegistry.h
191     text/TextBreakIterator.h
192     text/TextBreakIteratorInternalICU.h
193     text/TextStream.h
194     text/UniquedStringImpl.h
195     text/ValueToString.h
196     text/WTFString.h
197
198     text/icu/UTextProvider.h
199     text/icu/UTextProviderLatin1.h
200     text/icu/UTextProviderUTF16.h
201
202     threads/BinarySemaphore.h
203     threads/Signals.h
204
205     unicode/CharacterNames.h
206     unicode/Collator.h
207     unicode/UTF8.h
208 )
209
210 set(WTF_SOURCES
211     Assertions.cpp
212     Atomics.cpp
213     AutomaticThread.cpp
214     BitVector.cpp
215     CPUTime.cpp
216     ClockType.cpp
217     CompilationThread.cpp
218     CrossThreadCopier.cpp
219     CryptographicUtilities.cpp
220     CryptographicallyRandomNumber.cpp
221     CurrentTime.cpp
222     DataLog.cpp
223     DateMath.cpp
224     DecimalNumber.cpp
225     FastBitVector.cpp
226     FastMalloc.cpp
227     FilePrintStream.cpp
228     FunctionDispatcher.cpp
229     Gigacage.cpp
230     GlobalVersion.cpp
231     GregorianDateTime.cpp
232     HashTable.cpp
233     Language.cpp
234     Lock.cpp
235     LockedPrintStream.cpp
236     MD5.cpp
237     MainThread.cpp
238     MediaTime.cpp
239     MemoryPressureHandler.cpp
240     MetaAllocator.cpp
241     MonotonicTime.cpp
242     NumberOfCores.cpp
243     OSRandomSource.cpp
244     PageBlock.cpp
245     ParallelHelperPool.cpp
246     ParallelJobsGeneric.cpp
247     ParkingLot.cpp
248     PrintStream.cpp
249     RAMSize.cpp
250     RandomDevice.cpp
251     RandomNumber.cpp
252     ReadWriteLock.cpp
253     RefCountedLeakCounter.cpp
254     RunLoop.cpp
255     SHA1.cpp
256     Seconds.cpp
257     SixCharacterHash.cpp
258     StackBounds.cpp
259     StackStats.cpp
260     StackTrace.cpp
261     StringPrintStream.cpp
262     ThreadGroup.cpp
263     ThreadMessage.cpp
264     Threading.cpp
265     TimeWithDynamicClockType.cpp
266     UUID.cpp
267     WallTime.cpp
268     WordLock.cpp
269     WorkQueue.cpp
270     dtoa.cpp
271
272     dtoa/bignum-dtoa.cc
273     dtoa/bignum.cc
274     dtoa/cached-powers.cc
275     dtoa/diy-fp.cc
276     dtoa/double-conversion.cc
277     dtoa/fast-dtoa.cc
278     dtoa/fixed-dtoa.cc
279     dtoa/strtod.cc
280
281     persistence/PersistentCoders.cpp
282     persistence/PersistentDecoder.cpp
283     persistence/PersistentEncoder.cpp
284
285     text/AtomicString.cpp
286     text/AtomicStringImpl.cpp
287     text/AtomicStringTable.cpp
288     text/Base64.cpp
289     text/CString.cpp
290     text/StringBuilder.cpp
291     text/StringBuilderJSON.cpp
292     text/StringImpl.cpp
293     text/StringMalloc.cpp
294     text/StringView.cpp
295     text/SymbolImpl.cpp
296     text/SymbolRegistry.cpp
297     text/TextBreakIterator.cpp
298     text/TextStream.cpp
299     text/WTFString.cpp
300
301     text/icu/UTextProvider.cpp
302     text/icu/UTextProviderLatin1.cpp
303     text/icu/UTextProviderUTF16.cpp
304
305     threads/BinarySemaphore.cpp
306     threads/Signals.cpp
307
308     unicode/UTF8.cpp
309 )
310
311 set(WTF_INCLUDE_DIRECTORIES
312     "${BMALLOC_DIR}"
313     "${WTF_DIR}"
314     "${CMAKE_BINARY_DIR}"
315     "${DERIVED_SOURCES_DIR}"
316     "${THIRDPARTY_DIR}"
317 )
318
319 set(WTF_PRIVATE_INCLUDE_DIRECTORIES
320     "${WTF_DIR}/wtf"
321     "${WTF_DIR}/wtf/dtoa"
322     "${WTF_DIR}/wtf/persistence"
323     "${WTF_DIR}/wtf/text"
324     "${WTF_DIR}/wtf/text/icu"
325     "${WTF_DIR}/wtf/threads"
326     "${WTF_DIR}/wtf/unicode"
327 )
328
329 set(WTF_LIBRARIES
330     ${CMAKE_DL_LIBS}
331 )
332
333 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
334     list(APPEND WTF_HEADERS
335         spi/darwin/CommonCryptoSPI.h
336     )
337     list(APPEND WTF_INCLUDE_DIRECTORIES
338         "${WTF_DIR}/wtf/spi/darwin"
339     )
340 endif ()
341
342 if (NOT USE_SYSTEM_MALLOC)
343     list(APPEND WTF_LIBRARIES bmalloc)
344 endif ()
345
346 list(APPEND WTF_SOURCES
347     unicode/icu/CollatorICU.cpp
348 )
349 set(WTF_SYSTEM_INCLUDE_DIRECTORIES
350     ${ICU_INCLUDE_DIRS}
351 )
352 list(APPEND WTF_LIBRARIES
353     ${ICU_DATA_LIBRARIES}
354     ${ICU_I18N_LIBRARIES}
355     ${ICU_LIBRARIES}
356 )
357
358 if (WIN32)
359     list(APPEND WTF_SOURCES
360         OSAllocatorWin.cpp
361         ThreadSpecificWin.cpp
362         ThreadingWin.cpp
363     )
364     list(APPEND WTF_LIBRARIES
365         winmm
366     )
367 else ()
368     list(APPEND WTF_SOURCES
369         OSAllocatorPosix.cpp
370         ThreadingPthreads.cpp
371     )
372 endif ()
373
374 WEBKIT_FRAMEWORK_DECLARE(WTF)
375 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
376
377 WEBKIT_WRAP_SOURCELIST(${WTF_SOURCES})
378 WEBKIT_FRAMEWORK(WTF)
379
380 if (MSVC)
381     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
382     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
383
384     add_custom_command(
385         TARGET WTF
386         PRE_BUILD
387         COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/auto-version.pl ${DERIVED_SOURCES_DIR}
388         VERBATIM)
389
390     add_custom_command(
391         TARGET WTF
392         POST_BUILD
393         COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/version-stamp.pl ${DERIVED_SOURCES_DIR} $<TARGET_FILE:WTF>
394         VERBATIM)
395 endif ()
396
397 file(MAKE_DIRECTORY ${FORWARDING_HEADERS_DIR}/WTF/Scripts)
398
399 file(COPY
400     ../Scripts/generate-unified-source-bundles.rb
401     DESTINATION
402     ${FORWARDING_HEADERS_DIR}/WTF/Scripts
403 )