[libc][NFC] Move aligned access implementations to separate header
[llvm-project.git] / libc / src / __support / threads / CMakeLists.txt
blob0feeda0c179b9f70f5c516166bb3ed586cbf211b
1 add_header_library(
2   mutex_common
3   HDRS
4     mutex_common.h
7 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})
8   add_subdirectory(${LIBC_TARGET_OS})
9 endif()
11 if(TARGET libc.src.__support.threads.${LIBC_TARGET_OS}.mutex)
12   add_header_library(
13     mutex
14     HDRS
15       mutex.h
16     DEPENDS
17       .${LIBC_TARGET_OS}.mutex
18   )
20   add_object_library(
21     fork_callbacks
22     SRCS
23       fork_callbacks.cpp
24     HDRS
25       fork_callbacks.h
26     DEPENDS
27       .mutex
28   )
29 endif()
31 add_header_library(
32   thread_common
33   HDRS
34     thread.h
35   DEPENDS
36     libc.src.__support.common
37     libc.src.__support.CPP.atomic
38     libc.src.__support.CPP.optional
39     libc.src.__support.CPP.string_view
40     libc.src.__support.CPP.stringstream
43 if(TARGET libc.src.__support.threads.${LIBC_TARGET_OS}.thread)
44   add_object_library(
45     thread
46     SRCS
47       thread.cpp
48     DEPENDS
49       .mutex
50       .${LIBC_TARGET_OS}.thread
51       libc.src.__support.common
52       libc.src.__support.fixedvector
53       libc.src.__support.CPP.array
54       libc.src.__support.CPP.optional
55   )
56 endif()
58 if(TARGET libc.src.__support.threads.${LIBC_TARGET_OS}.callonce)
59   add_object_library(
60     callonce
61     ALIAS
62     DEPENDS
63       .${LIBC_TARGET_OS}.callonce
64   )
65 endif()