1add_header_library(
2  futex_word_type
3  HDRS
4    futex_word.h
5)
6
7if(NOT TARGET libc.src.__support.OSUtil.osutil)
8  return()
9endif()
10
11add_header_library(
12  mutex
13  HDRS
14    mutex.h
15  DEPENDS
16    .futex_word_type
17    libc.include.sys_syscall
18    libc.src.__support.CPP.atomic
19    libc.src.__support.OSUtil.osutil
20    libc.src.__support.threads.mutex_common
21)
22
23add_object_library(
24  thread
25  SRCS
26    thread.cpp
27  DEPENDS
28    .futex_word_type
29    libc.config.linux.app_h
30    libc.include.sys_syscall
31    libc.src.__support.CPP.atomic
32    libc.src.__support.CPP.error
33    libc.src.__support.threads.thread_common
34  COMPILE_OPTIONS
35    -O3
36    -fno-omit-frame-pointer # This allows us to sniff out the thread args from
37                            # the new thread's stack reliably.
38)
39