1add_header_library( 2 mutex_common 3 HDRS 4 mutex_common.h 5) 6 7add_header_library( 8 sleep 9 HDRS 10 sleep.h 11) 12 13add_header_library( 14 spin_lock 15 HDRS 16 spin_lock.h 17 DEPENDS 18 .sleep 19 libc.src.__support.CPP.atomic 20) 21 22if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS}) 23 add_subdirectory(${LIBC_TARGET_OS}) 24endif() 25 26if(TARGET libc.src.__support.threads.${LIBC_TARGET_OS}.mutex) 27 add_header_library( 28 mutex 29 HDRS 30 mutex.h 31 DEPENDS 32 .${LIBC_TARGET_OS}.mutex 33 ) 34 35 add_object_library( 36 fork_callbacks 37 SRCS 38 fork_callbacks.cpp 39 HDRS 40 fork_callbacks.h 41 DEPENDS 42 .mutex 43 libc.src.__support.CPP.mutex 44 ) 45endif() 46 47add_header_library( 48 thread_common 49 HDRS 50 thread.h 51 DEPENDS 52 libc.src.__support.common 53 libc.src.__support.CPP.atomic 54 libc.src.__support.CPP.optional 55 libc.src.__support.CPP.string_view 56 libc.src.__support.CPP.stringstream 57) 58 59if(TARGET libc.src.__support.threads.${LIBC_TARGET_OS}.thread) 60 add_object_library( 61 thread 62 SRCS 63 thread.cpp 64 DEPENDS 65 .mutex 66 .${LIBC_TARGET_OS}.thread 67 libc.src.__support.common 68 libc.src.__support.fixedvector 69 libc.src.__support.CPP.array 70 libc.src.__support.CPP.mutex 71 libc.src.__support.CPP.optional 72 ) 73endif() 74 75if(TARGET libc.src.__support.threads.${LIBC_TARGET_OS}.callonce) 76 add_object_library( 77 callonce 78 ALIAS 79 DEPENDS 80 .${LIBC_TARGET_OS}.callonce 81 ) 82endif() 83 84if(TARGET libc.src.__support.threads.${LIBC_TARGET_OS}.CndVar) 85 add_object_library( 86 CndVar 87 ALIAS 88 DEPENDS 89 .${LIBC_TARGET_OS}.CndVar 90 ) 91endif() 92 93if (LLVM_LIBC_FULL_BUILD) 94 set(identifier_dependency_on_thread libc.src.__support.threads.thread) 95endif() 96 97add_header_library( 98 identifier 99 HDRS 100 identifier.h 101 DEPENDS 102 libc.src.__support.OSUtil.osutil 103 libc.src.__support.common 104 libc.include.sys_syscall 105 libc.hdr.types.pid_t 106 ${identifier_dependency_on_thread} 107) 108