Skip to content

[libc] Make add_header and add_gen_header targets normal library targets. #66045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions libc/cmake/modules/LLVMLibCHeaderRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ function(add_header target_name)
)

get_fq_target_name(${target_name} fq_target_name)
set(copied_hdr_target ${fq_target_name}.__copied_hdr__)
add_custom_target(
${fq_target_name}
${copied_hdr_target}
DEPENDS ${dest_file}
)

Expand All @@ -46,10 +47,15 @@ function(add_header target_name)
endif()
endforeach()
add_dependencies(
${fq_target_name} ${fq_deps_list}
${copied_hdr_target} ${fq_deps_list}
)
endif()

add_header_library(
${target_name}
HDRS
${dest_file}
)
set_target_properties(
${fq_target_name}
PROPERTIES
Expand Down Expand Up @@ -159,11 +165,18 @@ function(add_gen_header target_name)
endif()
endforeach()
endif()
set(generated_hdr_target ${fq_target_name}.__generated_hdr__)
add_custom_target(
${fq_target_name}
${generated_hdr_target}
DEPENDS ${out_file} ${fq_deps_list} ${decl_out_file}
)

add_header_library(
${target_name}
HDRS
${out_file}
)

set_target_properties(
${fq_target_name}
PROPERTIES
Expand Down