[WTF] Add environment variable helpers
[WebKit-https.git] / Source / WTF / wtf / PlatformJSCOnly.cmake
1 list(APPEND WTF_SOURCES
2     generic/WorkQueueGeneric.cpp
3 )
4
5 if (WIN32)
6     list(APPEND WTF_SOURCES
7         text/win/TextBreakIteratorInternalICUWin.cpp
8
9         win/CPUTimeWin.cpp
10         win/DbgHelperWin.cpp
11         win/EnvironmentWin.cpp
12         win/FileSystemWin.cpp
13         win/LanguageWin.cpp
14         win/MainThreadWin.cpp
15         win/OSAllocatorWin.cpp
16         win/PathWalker.cpp
17         win/ThreadSpecificWin.cpp
18         win/ThreadingWin.cpp
19     )
20     list(APPEND WTF_PUBLIC_HEADERS
21         win/DbgHelperWin.h
22         win/PathWalker.h
23
24         text/win/WCharStringExtras.h
25     )
26     list(APPEND WTF_LIBRARIES
27         DbgHelp
28         shlwapi
29         winmm
30     )
31 else ()
32     list(APPEND WTF_SOURCES
33         UniStdExtras.cpp
34
35         generic/MainThreadGeneric.cpp
36
37         posix/EnvironmentPOSIX.cpp
38         posix/FileSystemPOSIX.cpp
39         posix/OSAllocatorPOSIX.cpp
40         posix/ThreadingPOSIX.cpp
41
42         text/unix/TextBreakIteratorInternalICUUnix.cpp
43
44         unix/LanguageUnix.cpp
45     )
46     if (WTF_OS_FUCHSIA)
47         list(APPEND WTF_SOURCES
48             fuchsia/CPUTimeFuchsia.cpp
49         )
50     else ()
51         list(APPEND WTF_SOURCES
52             unix/CPUTimeUnix.cpp
53         )
54     endif ()
55 endif ()
56
57 if (WIN32)
58     list(APPEND WTF_SOURCES
59         win/MemoryFootprintWin.cpp
60     )
61     list(APPEND WTF_PUBLIC_HEADERS
62         win/Win32Handle.h
63     )
64 elseif (APPLE)
65     file(COPY mac/MachExceptions.defs DESTINATION ${DERIVED_SOURCES_WTF_DIR})
66     add_custom_command(
67         OUTPUT
68             ${DERIVED_SOURCES_WTF_DIR}/MachExceptionsServer.h
69             ${DERIVED_SOURCES_WTF_DIR}/mach_exc.h
70             ${DERIVED_SOURCES_WTF_DIR}/mach_excServer.c
71             ${DERIVED_SOURCES_WTF_DIR}/mach_excUser.c
72         MAIN_DEPENDENCY mac/MachExceptions.defs
73         WORKING_DIRECTORY ${DERIVED_SOURCES_WTF_DIR}
74         COMMAND mig -sheader MachExceptionsServer.h MachExceptions.defs
75         VERBATIM)
76     list(APPEND WTF_SOURCES
77         cocoa/MemoryFootprintCocoa.cpp
78         ${DERIVED_SOURCES_WTF_DIR}/mach_excServer.c
79         ${DERIVED_SOURCES_WTF_DIR}/mach_excUser.c
80     )
81     list(APPEND WTF_INCLUDE_DIRECTORIES
82         ${DERIVED_SOURCES_WTF_DIR}
83     )
84 elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
85     list(APPEND WTF_SOURCES
86         linux/CurrentProcessMemoryStatus.cpp
87         linux/MemoryFootprintLinux.cpp
88         linux/MemoryPressureHandlerLinux.cpp
89     )
90     list(APPEND WTF_PUBLIC_HEADERS
91         linux/CurrentProcessMemoryStatus.h
92     )
93 else ()
94     list(APPEND WTF_SOURCES
95         generic/MemoryFootprintGeneric.cpp
96         generic/MemoryPressureHandlerGeneric.cpp
97     )
98 endif ()
99
100 if (LOWERCASE_EVENT_LOOP_TYPE STREQUAL "glib")
101     list(APPEND WTF_SOURCES
102         glib/GRefPtr.cpp
103         glib/RunLoopGLib.cpp
104     )
105     list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES
106         ${GLIB_INCLUDE_DIRS}
107     )
108     list(APPEND WTF_LIBRARIES
109         ${GLIB_GIO_LIBRARIES}
110         ${GLIB_GOBJECT_LIBRARIES}
111         ${GLIB_LIBRARIES}
112     )
113 else ()
114     list(APPEND WTF_SOURCES
115         generic/RunLoopGeneric.cpp
116     )
117 endif ()
118
119 list(APPEND WTF_LIBRARIES
120     ${CMAKE_THREAD_LIBS_INIT}
121 )
122
123 if (APPLE)
124     list(APPEND WTF_INCLUDE_DIRECTORIES
125         "${WTF_DIR}/icu"
126     )
127 endif ()