Skip to content

Commit

Permalink
[libc][cmake] separate installing headers
Browse files Browse the repository at this point in the history
Now libc headers can be installed separately from installing the rest of
the libc.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D133960
  • Loading branch information
michaelrj-google committed Sep 16, 2022
1 parent 6e30a9c commit 70f1f30
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion libc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion libc/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 70f1f30

Please sign in to comment.