Skip to content

Commit a72f7fc

Browse files
authored
[libc] Add generate-libc-headers custom target (llvm#191160)
Added the generate-libc-headers custom target depending on libc-headers. This allows troubleshooting headers without needing to install them first.
1 parent e267605 commit a72f7fc

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

libc/docs/full_host_build.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ tests with the following command:
5454
5555
ninja -C build libc libm check-libc
5656
57+
To build just the generated headers (useful for troubleshooting):
58+
59+
.. code-block:: sh
60+
61+
ninja -C build generate-libc-headers
62+
5763
To run a specific unit test for a function, you can target it directly using its
5864
full name:
5965

libc/include/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,9 @@ function(get_all_install_header_targets out_var)
938938
endfunction(get_all_install_header_targets)
939939

940940
get_all_install_header_targets(all_install_header_targets ${TARGET_PUBLIC_HEADERS})
941+
add_custom_target(generate-libc-headers DEPENDS ${all_install_header_targets})
941942
add_library(libc-headers INTERFACE)
942-
add_dependencies(libc-headers ${all_install_header_targets})
943+
add_dependencies(libc-headers generate-libc-headers)
943944
target_include_directories(libc-headers SYSTEM INTERFACE ${LIBC_INCLUDE_DIR})
944945

945946
foreach(target IN LISTS all_install_header_targets)

0 commit comments

Comments
 (0)