[libc-commits] [libc] 70f1f30 - [libc][cmake] separate installing headers

Michael Jones via libc-commits libc-commits at lists.llvm.org
Fri Sep 16 15:50:36 PDT 2022


Author: Michael Jones
Date: 2022-09-16T15:50:28-07:00
New Revision: 70f1f302cae37243712352f7289bdee8d688412f

URL: https://github.com/llvm/llvm-project/commit/70f1f302cae37243712352f7289bdee8d688412f
DIFF: https://github.com/llvm/llvm-project/commit/70f1f302cae37243712352f7289bdee8d688412f.diff

LOG: [libc][cmake] separate installing headers

Now libc headers can be installed separately from installing the rest of
the libc.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D133960

Added: 
    

Modified: 
    libc/CMakeLists.txt
    libc/include/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 15af22476ad1..2c403b98cf41 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -148,7 +148,7 @@ set(LIBC_INSTALL_TARGET)
 if(LLVM_LIBC_FULL_BUILD)
   set(LIBC_TARGET libc)
   set(LIBC_COMPONENT libc)
-  set(LIBC_INSTALL_DEPENDS "libc;libc-headers;libc-startup")
+  set(LIBC_INSTALL_DEPENDS "libc;install-libc-headers;libc-startup")
   set(LIBC_INSTALL_TARGET install-libc)
   set(LIBC_ARCHIVE_NAME c)
 else()
@@ -187,6 +187,15 @@ if (LIBC_INCLUDE_DOCS)
   add_subdirectory(docs)
 endif()
 
+
+if(LLVM_LIBC_FULL_BUILD)
+  add_llvm_install_targets(
+    install-libc-headers
+    DEPENDS libc-headers
+    COMPONENT libc-headers
+  )
+endif()
+
 add_llvm_install_targets(
   ${LIBC_INSTALL_TARGET}
   DEPENDS ${LIBC_INSTALL_DEPENDS}

diff  --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index f9aefb76ac4a..04354c7c185f 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -286,5 +286,5 @@ foreach(target IN LISTS all_install_header_targets)
   get_filename_component(nested_dir ${relative_path} DIRECTORY)
   install(FILES ${header_file}
           DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${nested_dir}
-          COMPONENT ${LIBC_COMPONENT})
+          COMPONENT libc-headers)
 endforeach()


        


More information about the libc-commits mailing list