xref: /llvm-project/libc/src/pthread/CMakeLists.txt (revision c71418574f1bb9e4678428901775c8b633cded09)
1add_entrypoint_object(
2  pthread_attr_init
3  SRCS
4    pthread_attr_init.cpp
5  HDRS
6    pthread_attr_init.h
7  DEPENDS
8    libc.include.pthread
9)
10
11add_entrypoint_object(
12  pthread_attr_destroy
13  SRCS
14    pthread_attr_destroy.cpp
15  HDRS
16    pthread_attr_destroy.h
17  DEPENDS
18    libc.include.pthread
19)
20
21add_entrypoint_object(
22  pthread_attr_getdetachstate
23  SRCS
24    pthread_attr_getdetachstate.cpp
25  HDRS
26    pthread_attr_getdetachstate.h
27  DEPENDS
28    libc.include.pthread
29)
30
31add_entrypoint_object(
32  pthread_attr_setdetachstate
33  SRCS
34    pthread_attr_setdetachstate.cpp
35  HDRS
36    pthread_attr_setdetachstate.h
37  DEPENDS
38    libc.include.pthread
39    libc.src.errno.errno
40)
41
42add_entrypoint_object(
43  pthread_attr_getguardsize
44  SRCS
45    pthread_attr_getguardsize.cpp
46  HDRS
47    pthread_attr_getguardsize.h
48  DEPENDS
49    libc.include.pthread
50)
51
52add_entrypoint_object(
53  pthread_attr_setguardsize
54  SRCS
55    pthread_attr_setguardsize.cpp
56  HDRS
57    pthread_attr_setguardsize.h
58  DEPENDS
59    libc.include.pthread
60    libc.src.errno.errno
61)
62
63add_entrypoint_object(
64  pthread_attr_getstacksize
65  SRCS
66    pthread_attr_getstacksize.cpp
67  HDRS
68    pthread_attr_getstacksize.h
69  DEPENDS
70    libc.include.pthread
71)
72
73add_entrypoint_object(
74  pthread_attr_setstacksize
75  SRCS
76    pthread_attr_setstacksize.cpp
77  HDRS
78    pthread_attr_setstacksize.h
79  DEPENDS
80    libc.include.pthread
81    libc.src.errno.errno
82)
83
84add_entrypoint_object(
85  pthread_attr_getstack
86  SRCS
87    pthread_attr_getstack.cpp
88  HDRS
89    pthread_attr_getstack.h
90  DEPENDS
91    libc.include.pthread
92    libc.src.pthread.pthread_attr_getstacksize
93)
94
95add_entrypoint_object(
96  pthread_attr_setstack
97  SRCS
98    pthread_attr_setstack.cpp
99  HDRS
100    pthread_attr_setstack.h
101  DEPENDS
102    libc.include.pthread
103    libc.src.pthread.pthread_attr_setstacksize
104    libc.src.errno.errno
105)
106
107add_entrypoint_object(
108  pthread_condattr_destroy
109  SRCS
110    pthread_condattr_destroy.cpp
111  HDRS
112    pthread_condattr_destroy.h
113  DEPENDS
114    libc.include.pthread
115)
116
117add_entrypoint_object(
118  pthread_condattr_getclock
119  SRCS
120    pthread_condattr_getclock.cpp
121  HDRS
122    pthread_condattr_getclock.h
123  DEPENDS
124    libc.include.pthread
125    libc.include.sys_types
126)
127
128add_entrypoint_object(
129  pthread_condattr_getpshared
130  SRCS
131    pthread_condattr_getpshared.cpp
132  HDRS
133    pthread_condattr_getpshared.h
134  DEPENDS
135    libc.include.pthread
136)
137
138add_entrypoint_object(
139  pthread_condattr_init
140  SRCS
141    pthread_condattr_init.cpp
142  HDRS
143    pthread_condattr_init.h
144  DEPENDS
145    libc.include.pthread
146    libc.include.time
147)
148
149add_entrypoint_object(
150  pthread_condattr_setclock
151  SRCS
152    pthread_condattr_setclock.cpp
153  HDRS
154    pthread_condattr_setclock.h
155  DEPENDS
156    libc.include.pthread
157    libc.include.sys_types
158    libc.include.time
159    libc.src.errno.errno
160)
161
162add_entrypoint_object(
163  pthread_condattr_setpshared
164  SRCS
165    pthread_condattr_setpshared.cpp
166  HDRS
167    pthread_condattr_setpshared.h
168  DEPENDS
169    libc.include.pthread
170    libc.src.errno.errno
171)
172
173add_header_library(
174  pthread_mutexattr
175  HDRS
176    pthread_mutexattr.h
177  DEPENDS
178    libc.src.__support.common
179    libc.include.pthread
180)
181
182add_entrypoint_object(
183  pthread_mutexattr_init
184  SRCS
185    pthread_mutexattr_init.cpp
186  HDRS
187    pthread_mutexattr_init.h
188  DEPENDS
189    .pthread_mutexattr
190    libc.include.pthread
191)
192
193add_entrypoint_object(
194  pthread_mutexattr_gettype
195  SRCS
196    pthread_mutexattr_gettype.cpp
197  HDRS
198    pthread_mutexattr_gettype.h
199  DEPENDS
200    .pthread_mutexattr
201    libc.include.pthread
202)
203
204add_entrypoint_object(
205  pthread_mutexattr_settype
206  SRCS
207    pthread_mutexattr_settype.cpp
208  HDRS
209    pthread_mutexattr_settype.h
210  DEPENDS
211    .pthread_mutexattr
212    libc.include.pthread
213    libc.src.errno.errno
214)
215
216add_entrypoint_object(
217  pthread_mutexattr_destroy
218  SRCS
219    pthread_mutexattr_destroy.cpp
220  HDRS
221    pthread_mutexattr_destroy.h
222  DEPENDS
223    .pthread_mutexattr
224    libc.src.errno.errno
225    libc.include.pthread
226)
227
228add_entrypoint_object(
229  pthread_mutexattr_getrobust
230  SRCS
231    pthread_mutexattr_getrobust.cpp
232  HDRS
233    pthread_mutexattr_getrobust.h
234  DEPENDS
235    .pthread_mutexattr
236    libc.include.pthread
237)
238
239add_entrypoint_object(
240  pthread_mutexattr_setrobust
241  SRCS
242    pthread_mutexattr_setrobust.cpp
243  HDRS
244    pthread_mutexattr_setrobust.h
245  DEPENDS
246    .pthread_mutexattr
247    libc.include.pthread
248    libc.src.errno.errno
249)
250
251add_entrypoint_object(
252  pthread_mutexattr_getpshared
253  SRCS
254    pthread_mutexattr_getpshared.cpp
255  HDRS
256    pthread_mutexattr_getpshared.h
257  DEPENDS
258    .pthread_mutexattr
259    libc.include.pthread
260)
261
262add_entrypoint_object(
263  pthread_mutexattr_setpshared
264  SRCS
265    pthread_mutexattr_setpshared.cpp
266  HDRS
267    pthread_mutexattr_setpshared.h
268  DEPENDS
269    .pthread_mutexattr
270    libc.include.pthread
271    libc.src.errno.errno
272)
273
274add_entrypoint_object(
275  pthread_mutex_init
276  SRCS
277    pthread_mutex_init.cpp
278  HDRS
279    pthread_mutex_init.h
280  DEPENDS
281    .pthread_mutexattr
282    libc.src.errno.errno
283    libc.include.pthread
284    libc.src.__support.threads.mutex
285)
286
287add_entrypoint_object(
288  pthread_mutex_destroy
289  SRCS
290    pthread_mutex_destroy.cpp
291  HDRS
292    pthread_mutex_destroy.h
293  DEPENDS
294    libc.include.pthread
295    libc.src.__support.threads.mutex
296)
297
298add_entrypoint_object(
299  pthread_mutex_lock
300  SRCS
301    pthread_mutex_lock.cpp
302  HDRS
303    pthread_mutex_lock.h
304  DEPENDS
305    libc.include.pthread
306    libc.src.__support.threads.mutex
307)
308
309add_entrypoint_object(
310  pthread_mutex_unlock
311  SRCS
312    pthread_mutex_unlock.cpp
313  HDRS
314    pthread_mutex_unlock.h
315  DEPENDS
316    libc.include.pthread
317    libc.src.__support.threads.mutex
318)
319
320add_entrypoint_object(
321  pthread_create
322  SRCS
323    pthread_create.cpp
324  HDRS
325    pthread_create.h
326  DEPENDS
327    libc.include.pthread
328    libc.src.__support.threads.thread
329    libc.src.pthread.pthread_attr_destroy
330    libc.src.pthread.pthread_attr_init
331    libc.src.pthread.pthread_attr_getdetachstate
332    libc.src.pthread.pthread_attr_getguardsize
333    libc.src.pthread.pthread_attr_getstack
334    libc.src.errno.errno
335  COMPILE_OPTIONS
336    ${libc_opt_high_flag}
337    -fno-omit-frame-pointer
338)
339
340add_entrypoint_object(
341  pthread_join
342  SRCS
343    pthread_join.cpp
344  HDRS
345    pthread_join.h
346  DEPENDS
347    libc.include.pthread
348    libc.src.__support.threads.thread
349)
350
351add_entrypoint_object(
352  pthread_detach
353  SRCS
354    pthread_detach.cpp
355  HDRS
356    pthread_detach.h
357  DEPENDS
358    libc.include.pthread
359    libc.src.__support.threads.thread
360)
361
362add_entrypoint_object(
363  pthread_equal
364  SRCS
365    pthread_equal.cpp
366  HDRS
367    pthread_equal.h
368  DEPENDS
369    libc.include.pthread
370    libc.src.__support.threads.thread
371)
372
373add_entrypoint_object(
374  pthread_exit
375  SRCS
376    pthread_exit.cpp
377  HDRS
378    pthread_exit.h
379  DEPENDS
380    libc.include.pthread
381    libc.src.__support.threads.thread
382)
383
384add_entrypoint_object(
385  pthread_self
386  SRCS
387    pthread_self.cpp
388  HDRS
389    pthread_self.h
390  DEPENDS
391    libc.include.pthread
392    libc.src.__support.threads.thread
393)
394
395add_entrypoint_object(
396  pthread_setname_np
397  SRCS
398    pthread_setname_np.cpp
399  HDRS
400    pthread_setname_np.h
401  DEPENDS
402    libc.include.pthread
403    libc.src.__support.CPP.span
404    libc.src.__support.CPP.stringstream
405    libc.src.__support.threads.thread
406)
407
408add_entrypoint_object(
409  pthread_getname_np
410  SRCS
411    pthread_getname_np.cpp
412  HDRS
413    pthread_getname_np.h
414  DEPENDS
415    libc.include.pthread
416    libc.src.__support.CPP.span
417    libc.src.__support.CPP.stringstream
418    libc.src.__support.threads.thread
419)
420
421add_entrypoint_object(
422  pthread_key_create
423  SRCS
424    pthread_key_create.cpp
425  HDRS
426    pthread_key_create.h
427  DEPENDS
428    libc.include.pthread
429    libc.src.__support.threads.thread
430    libc.src.errno.errno
431)
432
433add_entrypoint_object(
434  pthread_key_delete
435  SRCS
436    pthread_key_delete.cpp
437  HDRS
438    pthread_key_delete.h
439  DEPENDS
440    libc.include.pthread
441    libc.src.__support.threads.thread
442    libc.src.errno.errno
443)
444
445add_entrypoint_object(
446  pthread_getspecific
447  SRCS
448    pthread_getspecific.cpp
449  HDRS
450    pthread_getspecific.h
451  DEPENDS
452    libc.include.pthread
453    libc.src.errno.errno
454    libc.src.__support.threads.thread
455)
456
457add_entrypoint_object(
458  pthread_setspecific
459  SRCS
460    pthread_setspecific.cpp
461  HDRS
462    pthread_setspecific.h
463  DEPENDS
464    libc.include.pthread
465    libc.src.__support.threads.thread
466    libc.src.errno.errno
467)
468
469add_entrypoint_object(
470  pthread_rwlockattr_destroy
471  SRCS
472    pthread_rwlockattr_destroy.cpp
473  HDRS
474    pthread_rwlockattr_destroy.h
475  DEPENDS
476    libc.include.pthread
477)
478
479add_entrypoint_object(
480  pthread_rwlockattr_getkind_np
481  SRCS
482    pthread_rwlockattr_getkind_np.cpp
483  HDRS
484    pthread_rwlockattr_getkind_np.h
485  DEPENDS
486    libc.include.pthread
487)
488
489add_entrypoint_object(
490  pthread_rwlockattr_getpshared
491  SRCS
492    pthread_rwlockattr_getpshared.cpp
493  HDRS
494    pthread_rwlockattr_getpshared.h
495  DEPENDS
496    libc.include.pthread
497)
498
499add_entrypoint_object(
500  pthread_rwlockattr_init
501  SRCS
502    pthread_rwlockattr_init.cpp
503  HDRS
504    pthread_rwlockattr_init.h
505  DEPENDS
506    libc.include.pthread
507)
508
509add_entrypoint_object(
510  pthread_rwlockattr_setkind_np
511  SRCS
512    pthread_rwlockattr_setkind_np.cpp
513  HDRS
514    pthread_rwlockattr_setkind_np.h
515  DEPENDS
516    libc.include.pthread
517    libc.src.errno.errno
518)
519
520add_entrypoint_object(
521  pthread_rwlockattr_setpshared
522  SRCS
523    pthread_rwlockattr_setpshared.cpp
524  HDRS
525    pthread_rwlockattr_setpshared.h
526  DEPENDS
527    libc.include.pthread
528    libc.src.errno.errno
529)
530
531add_entrypoint_object(
532  pthread_rwlock_init
533  SRCS
534    pthread_rwlock_init.cpp
535  HDRS
536    pthread_rwlock_init.h
537  DEPENDS
538    libc.include.pthread
539    libc.src.__support.threads.linux.rwlock
540    libc.src.__support.CPP.new
541)
542
543add_entrypoint_object(
544  pthread_rwlock_tryrdlock
545  SRCS
546    pthread_rwlock_tryrdlock.cpp
547  HDRS
548    pthread_rwlock_tryrdlock.h
549  DEPENDS
550    libc.include.pthread
551    libc.src.__support.threads.linux.rwlock
552)
553
554add_entrypoint_object(
555  pthread_rwlock_trywrlock
556  SRCS
557    pthread_rwlock_trywrlock.cpp
558  HDRS
559    pthread_rwlock_trywrlock.h
560  DEPENDS
561    libc.include.pthread
562    libc.src.__support.threads.linux.rwlock
563    libc.src.errno.errno
564)
565
566add_entrypoint_object(
567  pthread_rwlock_clockrdlock
568  SRCS
569    pthread_rwlock_clockrdlock.cpp
570  HDRS
571    pthread_rwlock_clockrdlock.h
572  DEPENDS
573    libc.include.pthread
574    libc.src.__support.threads.linux.rwlock
575)
576
577add_entrypoint_object(
578  pthread_rwlock_clockwrlock
579  SRCS
580    pthread_rwlock_clockwrlock.cpp
581  HDRS
582    pthread_rwlock_clockwrlock.h
583  DEPENDS
584    libc.include.pthread
585    libc.src.__support.threads.linux.rwlock
586)
587
588add_entrypoint_object(
589  pthread_rwlock_timedrdlock
590  SRCS
591    pthread_rwlock_timedrdlock.cpp
592  HDRS
593    pthread_rwlock_timedrdlock.h
594  DEPENDS
595    libc.include.pthread
596    libc.src.__support.threads.linux.rwlock
597    libc.src.errno.errno
598)
599
600add_entrypoint_object(
601  pthread_rwlock_timedwrlock
602  SRCS
603    pthread_rwlock_timedwrlock.cpp
604  HDRS
605    pthread_rwlock_timedwrlock.h
606  DEPENDS
607    libc.include.pthread
608    libc.src.__support.threads.linux.rwlock
609)
610
611add_entrypoint_object(
612  pthread_rwlock_rdlock
613  SRCS
614    pthread_rwlock_rdlock.cpp
615  HDRS
616    pthread_rwlock_rdlock.h
617  DEPENDS
618    libc.include.pthread
619    libc.src.__support.threads.linux.rwlock
620)
621
622add_entrypoint_object(
623  pthread_rwlock_wrlock
624  SRCS
625    pthread_rwlock_wrlock.cpp
626  HDRS
627    pthread_rwlock_wrlock.h
628  DEPENDS
629    libc.include.pthread
630    libc.src.__support.threads.linux.rwlock
631)
632
633add_entrypoint_object(
634  pthread_rwlock_unlock
635  SRCS
636    pthread_rwlock_unlock.cpp
637  HDRS
638    pthread_rwlock_unlock.h
639  DEPENDS
640    libc.include.pthread
641    libc.src.__support.threads.linux.rwlock
642    libc.src.errno.errno
643)
644
645add_entrypoint_object(
646  pthread_rwlock_destroy
647  SRCS
648    pthread_rwlock_destroy.cpp
649  HDRS
650    pthread_rwlock_destroy.h
651  DEPENDS
652    libc.include.pthread
653    libc.src.__support.threads.linux.rwlock
654)
655
656add_entrypoint_object(
657  pthread_spin_init
658  SRCS
659    pthread_spin_init.cpp
660  HDRS
661    pthread_spin_init.h
662  DEPENDS
663    libc.include.pthread
664    libc.src.__support.threads.spin_lock
665    libc.src.__support.threads.identifier
666    libc.hdr.errno_macros
667)
668
669add_entrypoint_object(
670  pthread_spin_destroy
671  SRCS
672    pthread_spin_destroy.cpp
673  HDRS
674    pthread_spin_destroy.h
675  DEPENDS
676    libc.include.pthread
677    libc.src.__support.threads.spin_lock
678    libc.src.__support.threads.identifier
679    libc.hdr.errno_macros
680)
681
682add_entrypoint_object(
683  pthread_spin_lock
684  SRCS
685    pthread_spin_lock.cpp
686  HDRS
687    pthread_spin_lock.h
688  DEPENDS
689    libc.include.pthread
690    libc.src.__support.threads.spin_lock
691    libc.src.__support.threads.identifier
692    libc.hdr.errno_macros
693)
694
695add_entrypoint_object(
696  pthread_spin_trylock
697  SRCS
698    pthread_spin_trylock.cpp
699  HDRS
700    pthread_spin_trylock.h
701  DEPENDS
702    libc.include.pthread
703    libc.src.__support.threads.spin_lock
704    libc.src.__support.threads.identifier
705    libc.hdr.errno_macros
706)
707
708add_entrypoint_object(
709  pthread_spin_unlock
710  SRCS
711    pthread_spin_unlock.cpp
712  HDRS
713    pthread_spin_unlock.h
714  DEPENDS
715    libc.include.pthread
716    libc.src.__support.threads.spin_lock
717    libc.src.__support.threads.identifier
718    libc.hdr.errno_macros
719)
720
721add_entrypoint_object(
722  pthread_once
723  SRCS
724    pthread_once.cpp
725  HDRS
726    pthread_once.h
727  DEPENDS
728    libc.include.pthread
729    libc.src.__support.threads.callonce
730)
731
732add_entrypoint_object(
733  pthread_atfork
734  SRCS
735    pthread_atfork.cpp
736  HDRS
737    pthread_atfork.h
738  DEPENDS
739    libc.include.pthread
740    libc.src.__support.threads.fork_callbacks
741    libc.src.errno.errno
742)
743