Skip to content

Commit 9048aa7

Browse files
authored
[libc] Make add_header and add_gen_header targets normal library targets. (#66045)
This way, they can be added as deps to other library targets without any special handling.
1 parent 3e26690 commit 9048aa7

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

libc/cmake/modules/LLVMLibCHeaderRules.cmake

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ function(add_header target_name)
3030
)
3131

3232
get_fq_target_name(${target_name} fq_target_name)
33+
set(copied_hdr_target ${fq_target_name}.__copied_hdr__)
3334
add_custom_target(
34-
${fq_target_name}
35+
${copied_hdr_target}
3536
DEPENDS ${dest_file}
3637
)
3738

@@ -46,10 +47,15 @@ function(add_header target_name)
4647
endif()
4748
endforeach()
4849
add_dependencies(
49-
${fq_target_name} ${fq_deps_list}
50+
${copied_hdr_target} ${fq_deps_list}
5051
)
5152
endif()
5253

54+
add_header_library(
55+
${target_name}
56+
HDRS
57+
${dest_file}
58+
)
5359
set_target_properties(
5460
${fq_target_name}
5561
PROPERTIES
@@ -159,11 +165,18 @@ function(add_gen_header target_name)
159165
endif()
160166
endforeach()
161167
endif()
168+
set(generated_hdr_target ${fq_target_name}.__generated_hdr__)
162169
add_custom_target(
163-
${fq_target_name}
170+
${generated_hdr_target}
164171
DEPENDS ${out_file} ${fq_deps_list} ${decl_out_file}
165172
)
166173

174+
add_header_library(
175+
${target_name}
176+
HDRS
177+
${out_file}
178+
)
179+
167180
set_target_properties(
168181
${fq_target_name}
169182
PROPERTIES

0 commit comments

Comments
 (0)