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