118 lines · plain
1add_header_library(2 mutex_common3 HDRS4 mutex_common.h5)6 7add_header_library(8 sleep9 HDRS10 sleep.h11)12 13add_header_library(14 spin_lock15 HDRS16 spin_lock.h17 DEPENDS18 .sleep19 libc.src.__support.CPP.atomic20)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 mutex29 HDRS30 mutex.h31 DEPENDS32 .${LIBC_TARGET_OS}.mutex33 )34 35 add_object_library(36 fork_callbacks37 SRCS38 fork_callbacks.cpp39 HDRS40 fork_callbacks.h41 DEPENDS42 .mutex43 libc.src.__support.CPP.mutex44 )45elseif(NOT (LIBC_CONF_THREAD_MODE STREQUAL LIBC_THREAD_MODE_PLATFORM))46 add_header_library(47 mutex48 HDRS49 mutex.h50 DEPENDS51 .mutex_common52 )53endif()54 55add_header_library(56 thread_common57 HDRS58 thread.h59 DEPENDS60 libc.hdr.stdint_proxy61 libc.src.__support.common62 libc.src.__support.CPP.atomic63 libc.src.__support.CPP.optional64 libc.src.__support.CPP.string_view65 libc.src.__support.CPP.stringstream66)67 68if(TARGET libc.src.__support.threads.${LIBC_TARGET_OS}.thread)69 add_object_library(70 thread71 SRCS72 thread.cpp73 DEPENDS74 .mutex75 .${LIBC_TARGET_OS}.thread76 libc.hdr.stdint_proxy77 libc.src.__support.common78 libc.src.__support.fixedvector79 libc.src.__support.CPP.array80 libc.src.__support.CPP.mutex81 libc.src.__support.CPP.optional82 )83endif()84 85if(TARGET libc.src.__support.threads.${LIBC_TARGET_OS}.callonce)86 add_object_library(87 callonce88 ALIAS89 DEPENDS90 .${LIBC_TARGET_OS}.callonce91 )92endif()93 94if(TARGET libc.src.__support.threads.${LIBC_TARGET_OS}.CndVar)95 add_object_library(96 CndVar97 ALIAS98 DEPENDS99 .${LIBC_TARGET_OS}.CndVar100 )101endif()102 103if (LLVM_LIBC_FULL_BUILD)104 set(identifier_dependency_on_thread libc.src.__support.threads.thread)105endif()106 107add_header_library(108 identifier109 HDRS110 identifier.h111 DEPENDS112 libc.src.__support.OSUtil.osutil113 libc.src.__support.common114 libc.include.sys_syscall115 libc.hdr.types.pid_t116 ${identifier_dependency_on_thread}117)118