brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 253243f Raw
76 lines · plain
1if(NOT (TARGET libc.src.__support.threads.mutex)2   OR LIBC_TARGET_OS_IS_GPU)3  # Not all platforms have a mutex implementation. If mutex is unvailable,4  # we just skip everything about files.5  return()6endif()7 8add_object_library(9  file10  SRCS11    file.cpp12  HDRS13    file.h14  DEPENDS15    libc.hdr.stdio_macros16    libc.hdr.stdint_proxy17    libc.hdr.func.realloc18    libc.hdr.types.off_t19    libc.src.__support.CPP.new20    libc.src.__support.CPP.span21    libc.src.__support.threads.mutex22    libc.src.__support.error_or23)24 25add_object_library(26  dir27  SRCS28    dir.cpp29  HDRS30    dir.h31  DEPENDS32    libc.src.__support.CPP.mutex33    libc.src.__support.CPP.new34    libc.src.__support.CPP.span35    libc.src.__support.threads.mutex36)37 38if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})39  return()40endif()41 42add_subdirectory(${LIBC_TARGET_OS})43 44set(target_file libc.src.__support.File.${LIBC_TARGET_OS}.file)45set(target_stdout libc.src.__support.File.${LIBC_TARGET_OS}.stdout)46set(target_stderr libc.src.__support.File.${LIBC_TARGET_OS}.stderr)47set(target_stdin libc.src.__support.File.${LIBC_TARGET_OS}.stdin)48 49set(file_targets "${target_file};${target_stdout};${target_stdin};${target_stderr}")50set(file_aliases "platform_file;platform_stdout;platform_stdin;platform_stderr")51 52foreach(alias target IN ZIP_LISTS file_aliases file_targets)53  if(TARGET ${target})54    add_object_library(55      ${alias}56      ALIAS57        ${target}58      DEPENDS59        ${target}60    )61  endif()62endforeach()63 64set(target_dir libc.src.__support.File.${LIBC_TARGET_OS}.${LIBC_TARGET_OS}_dir)65if(NOT TARGET ${target_dir})66  return()67endif()68 69add_object_library(70  platform_dir71  ALIAS72    ${target_dir}73  DEPENDS74    ${target_dir}75)76