xref: /llvm-project/clang/lib/Headers/CMakeLists.txt (revision 9f06129e55a09ea6442b50a541a5ac55577c6a22)
1# core_files list contains the headers shared by all platforms.
2# Please consider adding new platform specific headers
3# to platform specific lists below.
4set(core_files
5  builtins.h
6  float.h
7  inttypes.h
8  iso646.h
9  limits.h
10  module.modulemap
11  stdalign.h
12  stdarg.h
13  __stdarg___gnuc_va_list.h
14  __stdarg___va_copy.h
15  __stdarg_header_macro.h
16  __stdarg_va_arg.h
17  __stdarg_va_copy.h
18  __stdarg_va_list.h
19  stdatomic.h
20  stdbool.h
21  stdckdint.h
22  stddef.h
23  __stddef_header_macro.h
24  __stddef_max_align_t.h
25  __stddef_null.h
26  __stddef_nullptr_t.h
27  __stddef_offsetof.h
28  __stddef_ptrdiff_t.h
29  __stddef_rsize_t.h
30  __stddef_size_t.h
31  __stddef_unreachable.h
32  __stddef_wchar_t.h
33  __stddef_wint_t.h
34  stdint.h
35  stdnoreturn.h
36  tgmath.h
37  unwind.h
38  varargs.h
39  )
40
41set(arm_common_files
42  # Headers shared by Arm and AArch64
43  arm_acle.h
44  )
45
46set(arm_only_files
47  arm_cmse.h
48  armintr.h
49  )
50
51set(aarch64_only_files
52  arm64intr.h
53  arm_neon_sve_bridge.h
54  )
55
56set(cuda_files
57  __clang_cuda_builtin_vars.h
58  __clang_cuda_math.h
59  __clang_cuda_cmath.h
60  __clang_cuda_complex_builtins.h
61  __clang_cuda_device_functions.h
62  __clang_cuda_intrinsics.h
63  __clang_cuda_texture_intrinsics.h
64  __clang_cuda_libdevice_declares.h
65  __clang_cuda_math_forward_declares.h
66  __clang_cuda_runtime_wrapper.h
67  )
68
69set(hexagon_files
70  hexagon_circ_brev_intrinsics.h
71  hexagon_protos.h
72  hexagon_types.h
73  hvx_hexagon_protos.h
74  )
75
76set(hip_files
77  __clang_hip_libdevice_declares.h
78  __clang_hip_cmath.h
79  __clang_hip_math.h
80  __clang_hip_stdlib.h
81  __clang_hip_runtime_wrapper.h
82  )
83
84set(hlsl_h
85  hlsl.h
86  )
87set(hlsl_subdir_files
88  hlsl/hlsl_basic_types.h
89  hlsl/hlsl_intrinsics.h
90  hlsl/hlsl_detail.h
91  )
92set(hlsl_files
93  ${hlsl_h}
94  ${hlsl_subdir_files}
95  )
96
97set(loongarch_files
98  larchintrin.h
99  lasxintrin.h
100  lsxintrin.h
101  )
102
103set(mips_msa_files
104  msa.h
105  )
106
107set(opencl_files
108  opencl-c.h
109  opencl-c-base.h
110  )
111
112set(ppc_files
113  altivec.h
114  )
115
116set(ppc_htm_files
117  htmintrin.h
118  htmxlintrin.h
119  )
120
121set(riscv_files
122  riscv_bitmanip.h
123        riscv_corev_alu.h
124  riscv_crypto.h
125  riscv_ntlh.h
126  sifive_vector.h
127  )
128
129set(systemz_files
130  s390intrin.h
131  vecintrin.h
132  )
133
134set(ve_files
135  velintrin.h
136  velintrin_gen.h
137  velintrin_approx.h
138  )
139
140set(webassembly_files
141  wasm_simd128.h
142  )
143
144set(x86_files
145# Intrinsics
146  adcintrin.h
147  adxintrin.h
148  ammintrin.h
149  amxavx512intrin.h
150  amxbf16transposeintrin.h
151  amxcomplexintrin.h
152  amxcomplextransposeintrin.h
153  amxfp16intrin.h
154  amxfp16transposeintrin.h
155  amxfp8intrin.h
156  amxintrin.h
157  amxmovrsintrin.h
158  amxmovrstransposeintrin.h
159  amxtf32intrin.h
160  amxtf32transposeintrin.h
161  amxtransposeintrin.h
162  avx10_2_512bf16intrin.h
163  avx10_2_512convertintrin.h
164  avx10_2_512minmaxintrin.h
165  avx10_2_512niintrin.h
166  avx10_2_512satcvtdsintrin.h
167  avx10_2_512satcvtintrin.h
168  avx10_2bf16intrin.h
169  avx10_2convertintrin.h
170  avx10_2copyintrin.h
171  avx10_2minmaxintrin.h
172  avx10_2niintrin.h
173  avx10_2satcvtdsintrin.h
174  avx10_2satcvtintrin.h
175  avx2intrin.h
176  avx512bf16intrin.h
177  avx512bitalgintrin.h
178  avx512bwintrin.h
179  avx512cdintrin.h
180  avx512dqintrin.h
181  avx512fintrin.h
182  avx512fp16intrin.h
183  avx512ifmaintrin.h
184  avx512ifmavlintrin.h
185  avx512vbmi2intrin.h
186  avx512vbmiintrin.h
187  avx512vbmivlintrin.h
188  avx512vlbf16intrin.h
189  avx512vlbitalgintrin.h
190  avx512vlbwintrin.h
191  avx512vlcdintrin.h
192  avx512vldqintrin.h
193  avx512vlfp16intrin.h
194  avx512vlintrin.h
195  avx512vlvbmi2intrin.h
196  avx512vlvnniintrin.h
197  avx512vlvp2intersectintrin.h
198  avx512vnniintrin.h
199  avx512vp2intersectintrin.h
200  avx512vpopcntdqintrin.h
201  avx512vpopcntdqvlintrin.h
202  avxifmaintrin.h
203  avxintrin.h
204  avxneconvertintrin.h
205  avxvnniint16intrin.h
206  avxvnniint8intrin.h
207  avxvnniintrin.h
208  bmi2intrin.h
209  bmiintrin.h
210  cetintrin.h
211  cldemoteintrin.h
212  clflushoptintrin.h
213  clwbintrin.h
214  clzerointrin.h
215  cmpccxaddintrin.h
216  crc32intrin.h
217  emmintrin.h
218  enqcmdintrin.h
219  f16cintrin.h
220  fma4intrin.h
221  fmaintrin.h
222  fxsrintrin.h
223  gfniintrin.h
224  hresetintrin.h
225  ia32intrin.h
226  immintrin.h
227  invpcidintrin.h
228  keylockerintrin.h
229  lwpintrin.h
230  lzcntintrin.h
231  mm3dnow.h
232  mmintrin.h
233  movdirintrin.h
234  movrs_avx10_2_512intrin.h
235  movrs_avx10_2intrin.h
236  movrsintrin.h
237  mwaitxintrin.h
238  nmmintrin.h
239  pconfigintrin.h
240  pkuintrin.h
241  pmmintrin.h
242  popcntintrin.h
243  prfchiintrin.h
244  prfchwintrin.h
245  ptrauth.h
246  ptwriteintrin.h
247  raointintrin.h
248  rdpruintrin.h
249  rdseedintrin.h
250  rtmintrin.h
251  serializeintrin.h
252  sgxintrin.h
253  sha512intrin.h
254  shaintrin.h
255  sm3intrin.h
256  sm4intrin.h
257  sm4evexintrin.h
258  smmintrin.h
259  tbmintrin.h
260  tmmintrin.h
261  tsxldtrkintrin.h
262  uintrintrin.h
263  usermsrintrin.h
264  vaesintrin.h
265  vpclmulqdqintrin.h
266  waitpkgintrin.h
267  wbnoinvdintrin.h
268  __wmmintrin_aes.h
269  wmmintrin.h
270  __wmmintrin_pclmul.h
271  x86gprintrin.h
272  x86intrin.h
273  xmmintrin.h
274  xopintrin.h
275  xsavecintrin.h
276  xsaveintrin.h
277  xsaveoptintrin.h
278  xsavesintrin.h
279  xtestintrin.h
280# others
281  cet.h
282  cpuid.h
283  )
284
285set(gpu_files
286  gpuintrin.h
287  nvptxintrin.h
288  amdgpuintrin.h
289  )
290
291set(windows_only_files
292  intrin0.h
293  intrin.h
294  vadefs.h
295  yvals_core.h
296)
297
298set(utility_files
299  mm_malloc.h
300)
301
302set(files
303  ${core_files}
304  ${arm_common_files}
305  ${arm_only_files}
306  ${aarch64_only_files}
307  ${cuda_files}
308  ${hexagon_files}
309  ${hip_files}
310  ${loongarch_files}
311  ${mips_msa_files}
312  ${opencl_files}
313  ${ppc_files}
314  ${ppc_htm_files}
315  ${riscv_files}
316  ${systemz_files}
317  ${ve_files}
318  ${x86_files}
319  ${gpu_files}
320  ${webassembly_files}
321  ${windows_only_files}
322  ${utility_files}
323  )
324
325set(cuda_wrapper_files
326  cuda_wrappers/algorithm
327  cuda_wrappers/cmath
328  cuda_wrappers/complex
329  cuda_wrappers/new
330)
331
332set(cuda_wrapper_bits_files
333  cuda_wrappers/bits/shared_ptr_base.h
334  cuda_wrappers/bits/basic_string.h
335  cuda_wrappers/bits/basic_string.tcc
336)
337
338set(ppc_wrapper_files
339  ppc_wrappers/mmintrin.h
340  ppc_wrappers/xmmintrin.h
341  ppc_wrappers/mm_malloc.h
342  ppc_wrappers/emmintrin.h
343  ppc_wrappers/pmmintrin.h
344  ppc_wrappers/tmmintrin.h
345  ppc_wrappers/smmintrin.h
346  ppc_wrappers/nmmintrin.h
347  ppc_wrappers/bmiintrin.h
348  ppc_wrappers/bmi2intrin.h
349  ppc_wrappers/immintrin.h
350  ppc_wrappers/x86intrin.h
351  ppc_wrappers/x86gprintrin.h
352)
353
354set(openmp_wrapper_files
355  openmp_wrappers/math.h
356  openmp_wrappers/cmath
357  # Due to a bug in CMake, `complex` must be before `complex.h`
358  # See: https://gitlab.kitware.com/cmake/cmake/-/issues/26058
359  openmp_wrappers/complex
360  openmp_wrappers/complex.h
361  openmp_wrappers/__clang_openmp_device_functions.h
362  openmp_wrappers/complex_cmath.h
363  openmp_wrappers/new
364)
365
366set(llvm_offload_wrapper_files
367  llvm_offload_wrappers/__llvm_offload.h
368  llvm_offload_wrappers/__llvm_offload_host.h
369  llvm_offload_wrappers/__llvm_offload_device.h
370)
371
372set(llvm_libc_wrapper_files
373  llvm_libc_wrappers/assert.h
374  llvm_libc_wrappers/stdio.h
375  llvm_libc_wrappers/stdlib.h
376  llvm_libc_wrappers/string.h
377  llvm_libc_wrappers/ctype.h
378  llvm_libc_wrappers/inttypes.h
379  llvm_libc_wrappers/time.h
380)
381
382set(zos_wrapper_files
383  zos_wrappers/builtins.h
384)
385
386include(GetClangResourceDir)
387get_clang_resource_dir(output_dir PREFIX ${LLVM_LIBRARY_OUTPUT_INTDIR}/.. SUBDIR include)
388set(out_files)
389set(generated_files)
390
391set(arm_common_generated_files)
392set(arm_only_generated_files)
393set(aarch64_only_generated_files)
394set(riscv_generated_files)
395
396function(copy_header_to_output_dir src_dir file)
397  set(src ${src_dir}/${file})
398  set(dst ${output_dir}/${file})
399  add_custom_command(OUTPUT ${dst}
400    DEPENDS ${src}
401    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
402    COMMENT "Copying clang's ${file}...")
403  list(APPEND out_files ${dst})
404  set(out_files ${out_files} PARENT_SCOPE)
405endfunction(copy_header_to_output_dir)
406
407function(clang_generate_header td_option td_file out_file)
408  clang_tablegen(${out_file} ${td_option}
409  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
410  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/${td_file})
411
412  copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
413  set(out_files ${out_files} PARENT_SCOPE)
414  list(APPEND generated_files "${CMAKE_CURRENT_BINARY_DIR}/${out_file}")
415  set(generated_files ${generated_files} PARENT_SCOPE)
416endfunction(clang_generate_header)
417
418
419# Copy header files from the source directory to the build directory
420foreach( f ${files} ${cuda_wrapper_files} ${cuda_wrapper_bits_files}
421           ${ppc_wrapper_files} ${openmp_wrapper_files} ${zos_wrapper_files} ${hlsl_files}
422	   ${llvm_libc_wrapper_files} ${llvm_offload_wrapper_files})
423  copy_header_to_output_dir(${CMAKE_CURRENT_SOURCE_DIR} ${f})
424endforeach( f )
425
426# Generate header files and copy them to the build directory
427if(ARM IN_LIST LLVM_TARGETS_TO_BUILD OR AArch64 IN_LIST LLVM_TARGETS_TO_BUILD)
428  # Generate arm_neon.h
429  clang_generate_header(-gen-arm-neon arm_neon.td arm_neon.h)
430  # Generate arm_fp16.h
431  clang_generate_header(-gen-arm-fp16 arm_fp16.td arm_fp16.h)
432  # Generate arm_sve.h
433  clang_generate_header(-gen-arm-sve-header arm_sve.td arm_sve.h)
434  # Generate arm_sme.h
435  clang_generate_header(-gen-arm-sme-header arm_sme.td arm_sme.h)
436  # Generate arm_bf16.h
437  clang_generate_header(-gen-arm-bf16 arm_bf16.td arm_bf16.h)
438  # Generate arm_mve.h
439  clang_generate_header(-gen-arm-mve-header arm_mve.td arm_mve.h)
440  # Generate arm_cde.h
441  clang_generate_header(-gen-arm-cde-header arm_cde.td arm_cde.h)
442  # Generate arm_vector_types.h
443  clang_generate_header(-gen-arm-vector-type arm_neon.td arm_vector_types.h)
444
445  # Add headers to target specific lists
446  list(APPEND arm_common_generated_files
447    "${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h"
448    "${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h"
449    )
450
451  list(APPEND arm_only_generated_files
452    "${CMAKE_CURRENT_BINARY_DIR}/arm_mve.h"
453    "${CMAKE_CURRENT_BINARY_DIR}/arm_cde.h"
454    )
455
456  list(APPEND aarch64_only_generated_files
457    "${CMAKE_CURRENT_BINARY_DIR}/arm_sve.h"
458    "${CMAKE_CURRENT_BINARY_DIR}/arm_sme.h"
459    "${CMAKE_CURRENT_BINARY_DIR}/arm_bf16.h"
460    "${CMAKE_CURRENT_BINARY_DIR}/arm_vector_types.h"
461    )
462endif()
463if(RISCV IN_LIST LLVM_TARGETS_TO_BUILD)
464  # Generate riscv_vector.h
465  clang_generate_header(-gen-riscv-vector-header riscv_vector.td riscv_vector.h)
466  list(APPEND riscv_generated_files
467    "${CMAKE_CURRENT_BINARY_DIR}/riscv_vector.h"
468    )
469endif()
470
471
472# Check if the generated headers are included in a target specific lists
473# Currently, all generated headers are target specific.
474set(all_target_specific_generated_files
475  ${arm_common_generated_files}
476  ${arm_only_generated_files}
477  ${aarch64_only_generated_files}
478  ${riscv_generated_files})
479foreach( f ${generated_files} )
480  if (NOT ${f} IN_LIST all_target_specific_generated_files)
481    message(WARNING "${f} is a generated header but it is not included in any "
482                    "target specific header lists! The resource-headers "
483                    "distribtion target will be incorrect!")
484  endif()
485endforeach( f )
486
487function(add_header_target target_name file_list)
488  add_library(${target_name} INTERFACE ${file_list})
489  set_target_properties(${target_name} PROPERTIES
490    FOLDER "Clang/Resources"
491    RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
492endfunction()
493
494# The catch-all clang-resource-headers target
495add_library(clang-resource-headers INTERFACE ${out_files})
496set_target_properties("clang-resource-headers" PROPERTIES
497  FOLDER "Clang/Resources"
498  RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
499add_dependencies("clang-resource-headers"
500                 "core-resource-headers"
501                 "arm-common-resource-headers"
502                 "arm-resource-headers"
503                 "aarch64-resource-headers"
504                 "cuda-resource-headers"
505                 "hexagon-resource-headers"
506                 "hip-resource-headers"
507                 "hlsl-resource-headers"
508                 "loongarch-resource-headers"
509                 "mips-resource-headers"
510                 "ppc-resource-headers"
511                 "ppc-htm-resource-headers"
512                 "riscv-resource-headers"
513                 "systemz-resource-headers"
514                 "ve-resource-headers"
515                 "webassembly-resource-headers"
516                 "x86-resource-headers"
517                 "opencl-resource-headers"
518                 "openmp-resource-headers"
519                 "llvm-libc-resource-headers"
520                 "windows-resource-headers"
521                 "utility-resource-headers")
522
523# Core/common headers
524add_header_target("core-resource-headers" ${core_files})
525add_header_target("arm-common-resource-headers" "${arm_common_files};${arm_common_generated_files}")
526
527# Architecture/platform specific targets
528add_header_target("arm-resource-headers" "${arm_only_files};${arm_only_generated_files}")
529add_header_target("aarch64-resource-headers" "${aarch64_only_files};${aarch64_only_generated_files}")
530add_header_target("cuda-resource-headers" "${cuda_files};${cuda_wrapper_files};${cuda_wrapper_bits_files}")
531add_header_target("hexagon-resource-headers" "${hexagon_files}")
532add_header_target("hip-resource-headers" "${hip_files}")
533add_header_target("loongarch-resource-headers" "${loongarch_files}")
534add_header_target("mips-resource-headers" "${mips_msa_files}")
535add_header_target("ppc-resource-headers" "${ppc_files};${ppc_wrapper_files}")
536add_header_target("ppc-htm-resource-headers" "${ppc_htm_files}")
537add_header_target("riscv-resource-headers" "${riscv_files};${riscv_generated_files}")
538add_header_target("systemz-resource-headers" "${systemz_files};${zos_wrapper_files}")
539add_header_target("ve-resource-headers" "${ve_files}")
540add_header_target("webassembly-resource-headers" "${webassembly_files}")
541add_header_target("x86-resource-headers" "${x86_files}")
542add_header_target("gpu-resource-headers" "${gpu_files}")
543
544# Other header groupings
545add_header_target("hlsl-resource-headers" ${hlsl_files})
546add_header_target("opencl-resource-headers" ${opencl_files})
547add_header_target("llvm-libc-resource-headers" ${llvm_libc_wrapper_files})
548add_header_target("openmp-resource-headers" ${openmp_wrapper_files})
549add_header_target("llvm-offload-resource-headers" ${llvm_libc_wrapper_files})
550add_header_target("windows-resource-headers" ${windows_only_files})
551add_header_target("utility-resource-headers" ${utility_files})
552
553get_clang_resource_dir(header_install_dir SUBDIR include)
554target_include_directories(clang-resource-headers INTERFACE
555  $<BUILD_INTERFACE:${output_dir}>
556  $<INSTALL_INTERFACE:${header_install_dir}>)
557set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS clang-resource-headers)
558
559#############################################################
560# Install rules for the catch-all clang-resource-headers target
561install(
562  FILES ${files} ${generated_files}
563  DESTINATION ${header_install_dir}
564  COMPONENT clang-resource-headers)
565
566install(
567  FILES ${cuda_wrapper_files}
568  DESTINATION ${header_install_dir}/cuda_wrappers
569  COMPONENT clang-resource-headers)
570
571install(
572  FILES ${cuda_wrapper_bits_files}
573  DESTINATION ${header_install_dir}/cuda_wrappers/bits
574  COMPONENT clang-resource-headers)
575
576install(
577  FILES ${ppc_wrapper_files}
578  DESTINATION ${header_install_dir}/ppc_wrappers
579  COMPONENT clang-resource-headers)
580
581install(
582  FILES ${llvm_libc_wrapper_files}
583  DESTINATION ${header_install_dir}/llvm_libc_wrappers
584  COMPONENT clang-resource-headers)
585
586install(
587  FILES ${openmp_wrapper_files}
588  DESTINATION ${header_install_dir}/openmp_wrappers
589  COMPONENT clang-resource-headers)
590
591install(
592  FILES ${llvm_offload_wrapper_files}
593  DESTINATION ${header_install_dir}/llvm_offload_wrappers
594  COMPONENT clang-resource-headers)
595
596install(
597  FILES ${zos_wrapper_files}
598  DESTINATION ${header_install_dir}/zos_wrappers
599  COMPONENT clang-resource-headers)
600
601#############################################################
602# Install rules for separate header lists
603install(
604  FILES ${core_files}
605  DESTINATION ${header_install_dir}
606  EXCLUDE_FROM_ALL
607  COMPONENT core-resource-headers)
608
609install(
610  FILES ${arm_common_files} ${arm_common_generated_files}
611  DESTINATION ${header_install_dir}
612  EXCLUDE_FROM_ALL
613  COMPONENT arm-common-resource-headers)
614
615install(
616  FILES ${arm_only_files} ${arm_only_generated_files}
617  DESTINATION ${header_install_dir}
618  EXCLUDE_FROM_ALL
619  COMPONENT arm-resource-headers)
620
621install(
622  FILES ${aarch64_only_files} ${aarch64_only_generated_files}
623  DESTINATION ${header_install_dir}
624  EXCLUDE_FROM_ALL
625  COMPONENT aarch64-resource-headers)
626
627install(
628  FILES ${cuda_wrapper_files}
629  DESTINATION ${header_install_dir}/cuda_wrappers
630  EXCLUDE_FROM_ALL
631  COMPONENT cuda-resource-headers)
632
633install(
634  FILES ${cuda_wrapper_bits_files}
635  DESTINATION ${header_install_dir}/cuda_wrappers/bits
636  EXCLUDE_FROM_ALL
637  COMPONENT cuda-resource-headers)
638
639install(
640  FILES ${cuda_files}
641  DESTINATION ${header_install_dir}
642  EXCLUDE_FROM_ALL
643  COMPONENT cuda-resource-headers)
644
645install(
646  FILES ${hexagon_files}
647  DESTINATION ${header_install_dir}
648  EXCLUDE_FROM_ALL
649  COMPONENT hexagon-resource-headers)
650
651install(
652  FILES ${hip_files}
653  DESTINATION ${header_install_dir}
654  EXCLUDE_FROM_ALL
655  COMPONENT hip-resource-headers)
656
657install(
658  FILES ${loongarch_files}
659  DESTINATION ${header_install_dir}
660  EXCLUDE_FROM_ALL
661  COMPONENT loongarch-resource-headers)
662
663install(
664  FILES ${mips_msa_files}
665  DESTINATION ${header_install_dir}
666  EXCLUDE_FROM_ALL
667  COMPONENT mips-resource-headers)
668
669install(
670  FILES ${ppc_wrapper_files}
671  DESTINATION ${header_install_dir}/ppc_wrappers
672  EXCLUDE_FROM_ALL
673  COMPONENT ppc-resource-headers)
674
675install(
676  FILES ${ppc_files}
677  DESTINATION ${header_install_dir}
678  EXCLUDE_FROM_ALL
679  COMPONENT ppc-resource-headers)
680
681install(
682  FILES ${ppc_htm_files}
683  DESTINATION ${header_install_dir}
684  EXCLUDE_FROM_ALL
685  COMPONENT ppc-htm-resource-headers)
686
687install(
688  FILES ${riscv_generated_files}
689  DESTINATION ${header_install_dir}
690  EXCLUDE_FROM_ALL
691  COMPONENT riscv-resource-headers)
692
693install(
694  FILES ${riscv_files}
695  DESTINATION ${header_install_dir}
696  EXCLUDE_FROM_ALL
697  COMPONENT riscv-resource-headers)
698
699install(
700  FILES ${systemz_files}
701  DESTINATION ${header_install_dir}
702  EXCLUDE_FROM_ALL
703  COMPONENT systemz-resource-headers)
704
705install(
706  FILES ${zos_wrapper_files}
707  DESTINATION  ${header_install_dir}/zos_wrappers
708  EXCLUDE_FROM_ALL
709  COMPONENT systemz-resource-headers)
710
711install(
712  FILES ${ve_files}
713  DESTINATION ${header_install_dir}
714  EXCLUDE_FROM_ALL
715  COMPONENT ve-resource-headers)
716
717install(
718  FILES ${webassembly_files}
719  DESTINATION ${header_install_dir}
720  EXCLUDE_FROM_ALL
721  COMPONENT webassembly-resource-headers)
722
723install(
724  FILES ${x86_files}
725  DESTINATION ${header_install_dir}
726  EXCLUDE_FROM_ALL
727  COMPONENT x86-resource-headers)
728
729install(
730  FILES ${gpu_files}
731  DESTINATION ${header_install_dir}
732  EXCLUDE_FROM_ALL
733  COMPONENT gpu-resource-headers)
734
735if(NOT CLANG_ENABLE_HLSL)
736  set(EXCLUDE_HLSL EXCLUDE_FROM_ALL)
737endif()
738
739install(
740  FILES ${hlsl_h}
741  DESTINATION ${header_install_dir}
742  ${EXCLUDE_HLSL}
743  COMPONENT hlsl-resource-headers)
744
745install(
746  FILES ${hlsl_subdir_files}
747  DESTINATION ${header_install_dir}/hlsl
748  ${EXCLUDE_HLSL}
749  COMPONENT hlsl-resource-headers)
750
751install(
752  FILES ${opencl_files}
753  DESTINATION ${header_install_dir}
754  EXCLUDE_FROM_ALL
755  COMPONENT opencl-resource-headers)
756
757install(
758  FILES ${openmp_wrapper_files}
759  DESTINATION ${header_install_dir}/openmp_wrappers
760  EXCLUDE_FROM_ALL
761  COMPONENT openmp-resource-headers)
762
763install(
764  FILES ${llvm_offload_wrapper_files}
765  DESTINATION ${header_install_dir}/llvm_offload_wrappers
766  EXCLUDE_FROM_ALL
767  COMPONENT openmp-resource-headers)
768
769install(
770  FILES ${utility_files}
771  DESTINATION ${header_install_dir}
772  EXCLUDE_FROM_ALL
773  COMPONENT utility-resource-headers)
774
775install(
776  FILES ${windows_only_files}
777  DESTINATION ${header_install_dir}
778  EXCLUDE_FROM_ALL
779  COMPONENT windows-resource-headers)
780#############################################################
781
782if (NOT LLVM_ENABLE_IDE)
783  add_llvm_install_targets(install-clang-resource-headers
784                           DEPENDS clang-resource-headers
785                           COMPONENT clang-resource-headers)
786
787  add_llvm_install_targets(install-core-resource-headers
788                           DEPENDS core-resource-headers
789                           COMPONENT core-resource-headers)
790  add_llvm_install_targets(install-arm-common-resource-headers
791                           DEPENDS arm-common-resource-headers
792                           COMPONENT arm-common-resource-headers)
793  add_llvm_install_targets(install-arm-resource-headers
794                           DEPENDS arm-resource-headers
795                           COMPONENT arm-resource-headers)
796  add_llvm_install_targets(install-aarch64-resource-headers
797                           DEPENDS aarch64-resource-headers
798                           COMPONENT aarch64-resource-headers)
799  add_llvm_install_targets(install-cuda-resource-headers
800                           DEPENDS cuda-resource-headers
801                           COMPONENT cuda-resource-headers)
802  add_llvm_install_targets(install-hexagon-resource-headers
803                           DEPENDS hexagon-resource-headers
804                           COMPONENT hexagon-resource-headers)
805  add_llvm_install_targets(install-hip-resource-headers
806                           DEPENDS hip-resource-headers
807                           COMPONENT hip-resource-headers)
808  add_llvm_install_targets(install-mips-resource-headers
809                           DEPENDS mips-resource-headers
810                           COMPONENT mips-resource-headers)
811  add_llvm_install_targets(install-ppc-resource-headers
812                           DEPENDS ppc-resource-headers
813                           COMPONENT ppc-resource-headers)
814  add_llvm_install_targets(install-ppc-htm-resource-headers
815                           DEPENDS ppc-htm-resource-headers
816                           COMPONENT ppc-htm-resource-headers)
817  add_llvm_install_targets(install-riscv-resource-headers
818                           DEPENDS riscv-resource-headers
819                           COMPONENT riscv-resource-headers)
820  add_llvm_install_targets(install-systemz-resource-headers
821                           DEPENDS systemz-resource-headers
822                           COMPONENT systemz-resource-headers)
823  add_llvm_install_targets(install-ve-resource-headers
824                           DEPENDS ve-resource-headers
825                           COMPONENT ve-resource-headers)
826  add_llvm_install_targets(install-x86-resource-headers
827                           DEPENDS x86-resource-headers
828                           COMPONENT x86-resource-headers)
829  add_llvm_install_targets(install-webassembly-resource-headers
830                           DEPENDS webassembly-resource-headers
831                           COMPONENT webassembly-resource-headers)
832
833  add_llvm_install_targets(install-hlsl-resource-headers
834                           DEPENDS hlsl-resource-headers
835                           COMPONENT hlsl-resource-headers)
836  add_llvm_install_targets(install-opencl-resource-headers
837                           DEPENDS opencl-resource-headers
838                           COMPONENT opencl-resource-headers)
839  add_llvm_install_targets(install-openmp-resource-headers
840                           DEPENDS openmp-resource-headers
841                           COMPONENT openmp-resource-headers)
842  add_llvm_install_targets(install-windows-resource-headers
843                           DEPENDS windows-resource-headers
844                           COMPONENT windows-resource-headers)
845  add_llvm_install_targets(install-utility-resource-headers
846                           DEPENDS utility-resource-headers
847                           COMPONENT utility-resource-headers)
848endif()
849
850source_group("Clang Runtime Headers" FILES ${files})
851