[Workflow] Roll back some settings since they caused more issues
[llvm-project.git] / libc / lib / CMakeLists.txt
blobf257582ed9bdf2c92f55ed468f99b490ebe83b62
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)
7   else()
8     list(APPEND libc_archive_names c m)
9   endif()
10   list(APPEND libc_archive_targets libc libm)
11   list(APPEND libc_archive_entrypoint_lists
12        TARGET_LIBC_ENTRYPOINTS TARGET_LIBM_ENTRYPOINTS)
13 else()
14   list(APPEND libc_archive_names llvmlibc)
15   list(APPEND libc_archive_targets libc)
16   list(APPEND libc_archive_entrypoint_lists TARGET_LLVMLIBC_ENTRYPOINTS)
17 endif()
19 set(added_archive_targets "")
20 foreach(archive IN ZIP_LISTS
21         libc_archive_names libc_archive_targets libc_archive_entrypoint_lists)
22   if(NOT ${archive_2})
23     # If an entrypoint list is missing, then skip adding targets for it.
24     continue()
25   endif()
26   add_entrypoint_library(
27     ${archive_1}
28     DEPENDS
29       ${${archive_2}}
30   )
31   set_target_properties(
32     ${archive_1}
33     PROPERTIES
34       ARCHIVE_OUTPUT_NAME ${archive_0}
35   )
36   list(APPEND added_archive_targets ${archive_1})
37 endforeach()
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})
44 else()
45   set(LIBC_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX})
46 endif()
48 install(
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