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