1if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})
2  add_subdirectory(${LIBC_TARGET_OS})
3endif()
4
5add_entrypoint_object(
6  call_once
7  ALIAS
8  DEPENDS
9    .${LIBC_TARGET_OS}.call_once
10)
11
12add_entrypoint_object(
13  thrd_create
14  SRCS
15    thrd_create.cpp
16  HDRS
17    thrd_create.h
18  DEPENDS
19    libc.src.__support.threads.thread
20    libc.include.threads
21  COMPILE_OPTIONS
22    -O3
23    -fno-omit-frame-pointer # This allows us to sniff out the thread args from
24                            # the new thread's stack reliably.
25)
26
27add_entrypoint_object(
28  thrd_join
29  SRCS
30    thrd_join.cpp
31  HDRS
32    thrd_join.h
33  DEPENDS
34    libc.include.threads
35    libc.src.__support.threads.thread
36)
37
38add_entrypoint_object(
39  thrd_detach
40  SRCS
41    thrd_detach.cpp
42  HDRS
43    thrd_detach.h
44  DEPENDS
45    libc.include.threads
46    libc.src.__support.threads.thread
47)
48
49add_entrypoint_object(
50  thrd_current
51  SRCS
52    thrd_current.cpp
53  HDRS
54    thrd_current.h
55  DEPENDS
56    libc.include.threads
57    libc.src.__support.threads.thread
58)
59
60add_entrypoint_object(
61  thrd_equal
62  SRCS
63    thrd_equal.cpp
64  HDRS
65    thrd_equal.h
66  DEPENDS
67    libc.include.threads
68    libc.src.__support.threads.thread
69)
70
71add_entrypoint_object(
72  mtx_init
73  SRCS
74    mtx_init.cpp
75  HDRS
76    mtx_init.h
77  DEPENDS
78    libc.include.threads
79    libc.src.__support.threads.mutex
80)
81
82add_entrypoint_object(
83  mtx_destroy
84  SRCS
85    mtx_destroy.cpp
86  HDRS
87    mtx_destroy.h
88  DEPENDS
89    libc.include.threads
90    libc.src.__support.threads.mutex
91)
92
93add_entrypoint_object(
94  mtx_lock
95  SRCS
96    mtx_lock.cpp
97  HDRS
98    mtx_lock.h
99  DEPENDS
100    libc.include.threads
101    libc.src.__support.threads.mutex
102)
103
104add_entrypoint_object(
105  mtx_unlock
106  SRCS
107    mtx_unlock.cpp
108  HDRS
109    mtx_unlock.h
110  DEPENDS
111    libc.include.threads
112    libc.src.__support.threads.mutex
113)
114
115add_entrypoint_object(
116  cnd_init
117  ALIAS
118  DEPENDS
119    .${LIBC_TARGET_OS}.cnd_init
120)
121
122add_entrypoint_object(
123  cnd_destroy
124  ALIAS
125  DEPENDS
126    .${LIBC_TARGET_OS}.cnd_destroy
127)
128
129add_entrypoint_object(
130  cnd_wait
131  ALIAS
132  DEPENDS
133    .${LIBC_TARGET_OS}.cnd_wait
134)
135
136add_entrypoint_object(
137  cnd_signal
138  ALIAS
139  DEPENDS
140    .${LIBC_TARGET_OS}.cnd_signal
141)
142
143add_entrypoint_object(
144  cnd_broadcast
145  ALIAS
146  DEPENDS
147    .${LIBC_TARGET_OS}.cnd_broadcast
148)
149