11 avx512vlbitalgintrin.h
13 avx512vpopcntdqintrin.h
28 avx512vpopcntdqvlintrin.h
34 __clang_cuda_builtin_vars.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
92 __stddef_max_align_t.h
119 set(cuda_wrapper_files
120 cuda_wrappers/algorithm
121 cuda_wrappers/complex
125 set(ppc_wrapper_files
126 ppc_wrappers/mmintrin.h
129 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
133 function(copy_header_to_output_dir src_dir file)
134 set(src ${src_dir}/${file})
135 set(dst ${output_dir}/${file})
136 add_custom_command(OUTPUT ${dst}
138 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
139 COMMENT "Copying clang's ${file}...")
140 list(APPEND out_files ${dst})
141 set(out_files ${out_files} PARENT_SCOPE)
142 endfunction(copy_header_to_output_dir)
144 function(clang_generate_header td_option td_file out_file)
145 clang_tablegen(${out_file} ${td_option}
146 -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
147 SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/${td_file})
149 copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
150 set(out_files ${out_files} PARENT_SCOPE)
151 list(APPEND generated_files "${CMAKE_CURRENT_BINARY_DIR}/${out_file}")
152 set(generated_files ${generated_files} PARENT_SCOPE)
153 endfunction(clang_generate_header)
156 # Copy header files from the source directory to the build directory
157 foreach( f ${files} ${cuda_wrapper_files} ${ppc_wrapper_files} )
158 copy_header_to_output_dir(${CMAKE_CURRENT_SOURCE_DIR} ${f})
161 # Generate header files and copy them to the build directory
162 # Generate arm_neon.h
163 clang_generate_header(-gen-arm-neon arm_neon.td arm_neon.h)
164 # Generate arm_fp16.h
165 clang_generate_header(-gen-arm-fp16 arm_fp16.td arm_fp16.h)
167 add_custom_target(clang-resource-headers ALL DEPENDS ${out_files})
168 set_target_properties(clang-resource-headers PROPERTIES
170 RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
172 set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
175 FILES ${files} ${generated_files}
176 DESTINATION ${header_install_dir}
177 COMPONENT clang-resource-headers)
180 FILES ${cuda_wrapper_files}
181 DESTINATION ${header_install_dir}/cuda_wrappers
182 COMPONENT clang-resource-headers)
185 FILES ${ppc_wrapper_files}
186 DESTINATION ${header_install_dir}/ppc_wrappers
187 COMPONENT clang-resource-headers)
189 if (NOT LLVM_ENABLE_IDE)
190 add_llvm_install_targets(install-clang-resource-headers
191 DEPENDS clang-resource-headers
192 COMPONENT clang-resource-headers)