• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1set(files
2  altivec.h
3  avxintrin.h
4  avx2intrin.h
5  bmiintrin.h
6  bmi2intrin.h
7  emmintrin.h
8  float.h
9  fma4intrin.h
10  immintrin.h
11  iso646.h
12  limits.h
13  lzcntintrin.h
14  mm3dnow.h
15  mmintrin.h
16  mm_malloc.h
17  nmmintrin.h
18  pmmintrin.h
19  popcntintrin.h
20  smmintrin.h
21  stdalign.h
22  stdarg.h
23  stdbool.h
24  stddef.h
25  stdint.h
26  tgmath.h
27  tmmintrin.h
28  varargs.h
29  wmmintrin.h
30  x86intrin.h
31  xmmintrin.h
32  cpuid.h
33  unwind.h
34  module.map
35  )
36
37set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include)
38
39# If we are in an IDE that has a configuration directory, we need to
40# create a second copy of the headers so that 'clang' can find them if
41# it's run from the build directory.
42if(MSVC_IDE OR XCODE)
43   set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include)
44endif()
45
46# Generate arm_neon.h
47clang_tablegen(arm_neon.h.inc -gen-arm-neon
48  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
49
50set(out_files)
51foreach( f ${files} )
52  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
53  set( dst ${output_dir}/${f} )
54  add_custom_command(OUTPUT ${dst}
55    DEPENDS ${src}
56    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
57    COMMENT "Copying clang's ${f}...")
58  list(APPEND out_files ${dst})
59
60  if(other_output_dir)
61   set(other_dst ${other_output_dir}/${f})
62    add_custom_command(OUTPUT ${other_dst}
63      DEPENDS ${src}
64      COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${other_dst}
65      COMMENT "Copying clang's ${f}...")
66    list(APPEND out_files ${other_dst})
67  endif()
68endforeach( f )
69
70add_custom_command(OUTPUT ${output_dir}/arm_neon.h
71  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc
72  COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc ${output_dir}/arm_neon.h
73  COMMENT "Copying clang's arm_neon.h...")
74list(APPEND out_files ${output_dir}/arm_neon.h)
75
76if (other_output_dir)
77    set(other_dst ${other_output_dir}/arm_neon.h)
78    add_custom_command(OUTPUT ${other_dst}
79      DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc
80      COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc ${other_dst}
81      COMMENT "Copying clang's arm_neon.h...")
82    list(APPEND out_files ${other_dst})
83endif ()
84
85add_custom_target(clang-headers ALL DEPENDS ${out_files})
86set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
87
88install(FILES ${files} ${output_dir}/arm_neon.h
89  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
90  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
91