1 set(libc_archive_targets "")
2 set(libc_archive_names "")
3 set(libc_archive_entrypoint_lists "")
4 if(LLVM_LIBC_FULL_BUILD)
5 if(LIBC_TARGET_ARCHITECTURE_IS_GPU)
6 list(APPEND libc_archive_names cgpu mgpu)
8 list(APPEND libc_archive_names c m)
10 list(APPEND libc_archive_targets libc libm)
11 list(APPEND libc_archive_entrypoint_lists
12 TARGET_LIBC_ENTRYPOINTS TARGET_LIBM_ENTRYPOINTS)
14 list(APPEND libc_archive_names llvmlibc)
15 list(APPEND libc_archive_targets libc)
16 list(APPEND libc_archive_entrypoint_lists TARGET_LLVMLIBC_ENTRYPOINTS)
19 set(added_archive_targets "")
20 foreach(archive IN ZIP_LISTS
21 libc_archive_names libc_archive_targets libc_archive_entrypoint_lists)
23 # If an entrypoint list is missing, then skip adding targets for it.
26 add_entrypoint_library(
31 set_target_properties(
34 ARCHIVE_OUTPUT_NAME ${archive_0}
36 list(APPEND added_archive_targets ${archive_1})
39 if(LIBC_TARGET_TRIPLE)
40 set(LIBC_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LIBC_TARGET_TRIPLE})
41 elseif(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT LIBC_GPU_BUILD)
42 set(LIBC_INSTALL_LIBRARY_DIR
43 lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE})
45 set(LIBC_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX})
49 TARGETS ${added_archive_targets}
50 ARCHIVE DESTINATION ${LIBC_INSTALL_LIBRARY_DIR}
51 COMPONENT libc-static-archives
54 add_llvm_install_targets(
55 install-libc-static-archives
56 DEPENDS ${added_archive_targets}
57 COMPONENT libc-static-archives