blob: 6e9cc68540b6c20c22d1aacf52d58f66835cbec7 [file] [log] [blame]
Oscar Fuentesd2f4e5e2008-10-26 00:56:18 +00001set(files
Chris Lattnerdd173942010-04-14 03:54:58 +00002 altivec.h
Benjamin Kramer6ea73b22012-05-29 19:36:17 +00003 ammintrin.h
Bruno Cardoso Lopes55db5b82010-08-04 22:03:36 +00004 avxintrin.h
Craig Topper925be542011-12-19 05:04:33 +00005 avx2intrin.h
NAKAMURA Takumi6ab9f022011-12-25 12:47:46 +00006 bmiintrin.h
NAKAMURA Takumib5409c52011-12-26 03:20:06 +00007 bmi2intrin.h
Oscar Fuentesbe7025e2011-02-27 13:33:31 +00008 emmintrin.h
9 float.h
NAKAMURA Takumi5c76db32011-12-30 10:38:16 +000010 fma4intrin.h
Craig Topper97075fb2012-06-04 03:42:47 +000011 fmaintrin.h
Benjamin Kramer033b7b32010-08-20 18:04:07 +000012 immintrin.h
Oscar Fuentesbe7025e2011-02-27 13:33:31 +000013 iso646.h
14 limits.h
NAKAMURA Takumi6ab9f022011-12-25 12:47:46 +000015 lzcntintrin.h
Michael J. Spencer408d5d12011-04-15 15:11:21 +000016 mm3dnow.h
Oscar Fuentesbe7025e2011-02-27 13:33:31 +000017 mmintrin.h
18 mm_malloc.h
19 nmmintrin.h
20 pmmintrin.h
Richard Smith0945f202011-12-29 21:42:29 +000021 popcntintrin.h
Chris Lattner3a70f862010-08-20 17:24:02 +000022 smmintrin.h
Peter Collingbourne82d0b0a2011-09-29 18:04:28 +000023 stdalign.h
Oscar Fuentesbe7025e2011-02-27 13:33:31 +000024 stdarg.h
25 stdbool.h
26 stddef.h
27 stdint.h
Douglas Gregor06026002009-06-07 07:09:23 +000028 tgmath.h
29 tmmintrin.h
Oscar Fuentesbe7025e2011-02-27 13:33:31 +000030 varargs.h
31 wmmintrin.h
32 x86intrin.h
33 xmmintrin.h
Craig Topper239c0302012-06-10 00:39:38 +000034 xopintrin.h
Rafael Espindola82e11cd2011-12-06 15:46:47 +000035 cpuid.h
Rafael Espindolad85c1e92011-12-08 05:01:39 +000036 unwind.h
Douglas Gregor3e80d8a2012-01-29 20:52:14 +000037 module.map
Oscar Fuentesbe7025e2011-02-27 13:33:31 +000038 )
Oscar Fuentesd2f4e5e2008-10-26 00:56:18 +000039
Douglas Gregor105716e2010-10-19 18:06:10 +000040set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include)
Douglas Gregord1e6fdb2010-10-11 23:17:59 +000041
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.
45if(MSVC_IDE OR XCODE)
46 set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include)
47endif()
Douglas Gregorebfc1802009-06-16 20:13:51 +000048
Douglas Gregorc302f002010-05-28 04:22:06 +000049# Generate arm_neon.h
Oscar Fuentesc8da1ec2011-02-20 22:06:32 +000050clang_tablegen(arm_neon.h.inc -gen-arm-neon
51 SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
Douglas Gregorc302f002010-05-28 04:22:06 +000052
Douglas Gregord1e6fdb2010-10-11 23:17:59 +000053set(out_files)
Oscar Fuentesd2f4e5e2008-10-26 00:56:18 +000054foreach( 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}...")
Douglas Gregord1e6fdb2010-10-11 23:17:59 +000061 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()
Oscar Fuentesd2f4e5e2008-10-26 00:56:18 +000071endforeach( f )
72
Douglas Gregord1e6fdb2010-10-11 23:17:59 +000073add_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...")
77list(APPEND out_files ${output_dir}/arm_neon.h)
78
79if (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})
86endif ()
87
88add_custom_target(clang-headers ALL DEPENDS ${out_files})
Oscar Fuentesa3f787c2011-02-20 22:06:44 +000089set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
Oscar Fuentesd2f4e5e2008-10-26 00:56:18 +000090
Douglas Gregorc302f002010-05-28 04:22:06 +000091install(FILES ${files} ${output_dir}/arm_neon.h
Oscar Fuentesd2f4e5e2008-10-26 00:56:18 +000092 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
Oscar Fuentes25950e82009-10-27 21:15:21 +000093 DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)