1 | set(files |
2 | adxintrin.h |
3 | altivec.h |
4 | ammintrin.h |
5 | arm_acle.h |
6 | armintr.h |
7 | arm64intr.h |
8 | avx2intrin.h |
9 | avx512bwintrin.h |
10 | avx512bitalgintrin.h |
11 | avx512vlbitalgintrin.h |
12 | avx512cdintrin.h |
13 | avx512vpopcntdqintrin.h |
14 | avx512dqintrin.h |
15 | avx512erintrin.h |
16 | avx512fintrin.h |
17 | avx512ifmaintrin.h |
18 | avx512ifmavlintrin.h |
19 | avx512pfintrin.h |
20 | avx512vbmiintrin.h |
21 | avx512vbmivlintrin.h |
22 | avx512vbmi2intrin.h |
23 | avx512vlvbmi2intrin.h |
24 | avx512vlbwintrin.h |
25 | avx512vlcdintrin.h |
26 | avx512vldqintrin.h |
27 | avx512vlintrin.h |
28 | avx512vpopcntdqvlintrin.h |
29 | avx512vnniintrin.h |
30 | avx512vlvnniintrin.h |
31 | avxintrin.h |
32 | bmi2intrin.h |
33 | bmiintrin.h |
34 | __clang_cuda_builtin_vars.h |
35 | __clang_cuda_cmath.h |
36 | __clang_cuda_complex_builtins.h |
37 | __clang_cuda_device_functions.h |
38 | __clang_cuda_intrinsics.h |
39 | __clang_cuda_libdevice_declares.h |
40 | __clang_cuda_math_forward_declares.h |
41 | __clang_cuda_runtime_wrapper.h |
42 | cetintrin.h |
43 | cldemoteintrin.h |
44 | clzerointrin.h |
45 | cpuid.h |
46 | clflushoptintrin.h |
47 | clwbintrin.h |
48 | emmintrin.h |
49 | f16cintrin.h |
50 | float.h |
51 | fma4intrin.h |
52 | fmaintrin.h |
53 | fxsrintrin.h |
54 | gfniintrin.h |
55 | htmintrin.h |
56 | htmxlintrin.h |
57 | ia32intrin.h |
58 | immintrin.h |
59 | intrin.h |
60 | inttypes.h |
61 | invpcidintrin.h |
62 | iso646.h |
63 | limits.h |
64 | lwpintrin.h |
65 | lzcntintrin.h |
66 | mm3dnow.h |
67 | mmintrin.h |
68 | mm_malloc.h |
69 | module.modulemap |
70 | movdirintrin.h |
71 | msa.h |
72 | mwaitxintrin.h |
73 | nmmintrin.h |
74 | opencl-c.h |
75 | pkuintrin.h |
76 | pmmintrin.h |
77 | pconfigintrin.h |
78 | popcntintrin.h |
79 | prfchwintrin.h |
80 | ptwriteintrin.h |
81 | rdseedintrin.h |
82 | rtmintrin.h |
83 | sgxintrin.h |
84 | s390intrin.h |
85 | shaintrin.h |
86 | smmintrin.h |
87 | stdalign.h |
88 | stdarg.h |
89 | stdatomic.h |
90 | stdbool.h |
91 | stddef.h |
92 | __stddef_max_align_t.h |
93 | stdint.h |
94 | stdnoreturn.h |
95 | tbmintrin.h |
96 | tgmath.h |
97 | tmmintrin.h |
98 | unwind.h |
99 | vadefs.h |
100 | vaesintrin.h |
101 | varargs.h |
102 | vecintrin.h |
103 | vpclmulqdqintrin.h |
104 | waitpkgintrin.h |
105 | wbnoinvdintrin.h |
106 | wmmintrin.h |
107 | __wmmintrin_aes.h |
108 | __wmmintrin_pclmul.h |
109 | x86intrin.h |
110 | xmmintrin.h |
111 | xopintrin.h |
112 | xsavecintrin.h |
113 | xsaveintrin.h |
114 | xsaveoptintrin.h |
115 | xsavesintrin.h |
116 | xtestintrin.h |
117 | ) |
118 | |
119 | set(cuda_wrapper_files |
120 | cuda_wrappers/algorithm |
121 | cuda_wrappers/complex |
122 | cuda_wrappers/new |
123 | ) |
124 | |
125 | set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include) |
126 | set(out_files) |
127 | |
128 | function(copy_header_to_output_dir src_dir file) |
129 | set(src ${src_dir}/${file}) |
130 | set(dst ${output_dir}/${file}) |
131 | add_custom_command(OUTPUT ${dst} |
132 | DEPENDS ${src} |
133 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} |
134 | COMMENT "Copying clang's ${file}...") |
135 | list(APPEND out_files ${dst}) |
136 | set(out_files ${out_files} PARENT_SCOPE) |
137 | endfunction(copy_header_to_output_dir) |
138 | |
139 | function(clang_generate_header td_option td_file out_file) |
140 | clang_tablegen(${out_file} ${td_option} |
141 | -I ${CLANG_SOURCE_DIR}/include/clang/Basic/ |
142 | SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/${td_file}) |
143 | |
144 | copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file}) |
145 | set(out_files ${out_files} PARENT_SCOPE) |
146 | endfunction(clang_generate_header) |
147 | |
148 | |
149 | # Copy header files from the source directory to the build directory |
150 | foreach( f ${files} ${cuda_wrapper_files} ) |
151 | copy_header_to_output_dir(${CMAKE_CURRENT_SOURCE_DIR} ${f}) |
152 | endforeach( f ) |
153 | |
154 | # Generate header files and copy them to the build directory |
155 | # Generate arm_neon.h |
156 | clang_generate_header(-gen-arm-neon arm_neon.td arm_neon.h) |
157 | # Generate arm_fp16.h |
158 | clang_generate_header(-gen-arm-fp16 arm_fp16.td arm_fp16.h) |
159 | |
160 | add_custom_target(clang-resource-headers ALL DEPENDS ${out_files}) |
161 | set_target_properties(clang-resource-headers PROPERTIES |
162 | FOLDER "Misc" |
163 | RUNTIME_OUTPUT_DIRECTORY "${output_dir}") |
164 | |
165 | set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}) |
166 | |
167 | install( |
168 | DIRECTORY ${output_dir} |
169 | DESTINATION ${header_install_dir} |
170 | COMPONENT clang-resource-headers) |
171 | |
172 | if (NOT LLVM_ENABLE_IDE) |
173 | add_llvm_install_targets(install-clang-resource-headers |
174 | DEPENDS clang-resource-headers |
175 | COMPONENT clang-resource-headers) |
176 | endif() |
177 | |