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  mtx_init
51  SRCS
52    mtx_init.cpp
53  HDRS
54    mtx_init.h
55  DEPENDS
56    libc.include.threads
57    libc.src.__support.threads.mutex
58)
59
60add_entrypoint_object(
61  mtx_destroy
62  SRCS
63    mtx_destroy.cpp
64  HDRS
65    mtx_destroy.h
66  DEPENDS
67    libc.include.threads
68    libc.src.__support.threads.mutex
69)
70
71add_entrypoint_object(
72  mtx_lock
73  SRCS
74    mtx_lock.cpp
75  HDRS
76    mtx_lock.h
77  DEPENDS
78    libc.include.threads
79    libc.src.__support.threads.mutex
80)
81
82add_entrypoint_object(
83  mtx_unlock
84  SRCS
85    mtx_unlock.cpp
86  HDRS
87    mtx_unlock.h
88  DEPENDS
89    libc.include.threads
90    libc.src.__support.threads.mutex
91)
92
93add_entrypoint_object(
94  cnd_init
95  ALIAS
96  DEPENDS
97    .${LIBC_TARGET_OS}.cnd_init
98)
99
100add_entrypoint_object(
101  cnd_destroy
102  ALIAS
103  DEPENDS
104    .${LIBC_TARGET_OS}.cnd_destroy
105)
106
107add_entrypoint_object(
108  cnd_wait
109  ALIAS
110  DEPENDS
111    .${LIBC_TARGET_OS}.cnd_wait
112)
113
114add_entrypoint_object(
115  cnd_signal
116  ALIAS
117  DEPENDS
118    .${LIBC_TARGET_OS}.cnd_signal
119)
120
121add_entrypoint_object(
122  cnd_broadcast
123  ALIAS
124  DEPENDS
125    .${LIBC_TARGET_OS}.cnd_broadcast
126)
127