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.include.sys_syscall
30    libc.src.__support.CPP.atomic
31    libc.src.__support.CPP.error
32    libc.src.__support.threads.thread_common
33  COMPILE_OPTIONS
34    -O3
35    -fno-omit-frame-pointer # This allows us to sniff out the thread args from
36                            # the new thread's stack reliably.
37)
38