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