blob: 78141a3d07fff671aa8418c9605ab2b26257fed4 [file] [log] [blame]
Oscar Fuentesd2f4e5e2008-10-26 00:56:18 +00001set(files
Chris Lattnerdd173942010-04-14 03:54:58 +00002 altivec.h
Bruno Cardoso Lopes55db5b82010-08-04 22:03:36 +00003 avxintrin.h
Craig Topper925be542011-12-19 05:04:33 +00004 avx2intrin.h
NAKAMURA Takumi6ab9f022011-12-25 12:47:46 +00005 bmiintrin.h
NAKAMURA Takumib5409c52011-12-26 03:20:06 +00006 bmi2intrin.h
Oscar Fuentesbe7025e2011-02-27 13:33:31 +00007 emmintrin.h
8 float.h
NAKAMURA Takumi5c76db32011-12-30 10:38:16 +00009 fma4intrin.h
Benjamin Kramer033b7b32010-08-20 18:04:07 +000010 immintrin.h
Oscar Fuentesbe7025e2011-02-27 13:33:31 +000011 iso646.h
12 limits.h
NAKAMURA Takumi6ab9f022011-12-25 12:47:46 +000013 lzcntintrin.h
Michael J. Spencer408d5d12011-04-15 15:11:21 +000014 mm3dnow.h
Oscar Fuentesbe7025e2011-02-27 13:33:31 +000015 mmintrin.h
16 mm_malloc.h
17 nmmintrin.h
18 pmmintrin.h
Richard Smith0945f202011-12-29 21:42:29 +000019 popcntintrin.h
Chris Lattner3a70f862010-08-20 17:24:02 +000020 smmintrin.h
Peter Collingbourne82d0b0a2011-09-29 18:04:28 +000021 stdalign.h
Oscar Fuentesbe7025e2011-02-27 13:33:31 +000022 stdarg.h
23 stdbool.h
24 stddef.h
25 stdint.h
Douglas Gregor06026002009-06-07 07:09:23 +000026 tgmath.h
27 tmmintrin.h
Oscar Fuentesbe7025e2011-02-27 13:33:31 +000028 varargs.h
29 wmmintrin.h
30 x86intrin.h
31 xmmintrin.h
Rafael Espindola82e11cd2011-12-06 15:46:47 +000032 cpuid.h
Rafael Espindolad85c1e92011-12-08 05:01:39 +000033 unwind.h
Douglas Gregor3e80d8a2012-01-29 20:52:14 +000034 module.map
Oscar Fuentesbe7025e2011-02-27 13:33:31 +000035 )
Oscar Fuentesd2f4e5e2008-10-26 00:56:18 +000036
Douglas Gregor105716e2010-10-19 18:06:10 +000037set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include)
Douglas Gregord1e6fdb2010-10-11 23:17:59 +000038
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()
Douglas Gregorebfc1802009-06-16 20:13:51 +000045
Douglas Gregorc302f002010-05-28 04:22:06 +000046# Generate arm_neon.h
Oscar Fuentesc8da1ec2011-02-20 22:06:32 +000047clang_tablegen(arm_neon.h.inc -gen-arm-neon
48 SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
Douglas Gregorc302f002010-05-28 04:22:06 +000049
Douglas Gregord1e6fdb2010-10-11 23:17:59 +000050set(out_files)
Oscar Fuentesd2f4e5e2008-10-26 00:56:18 +000051foreach( 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}...")
Douglas Gregord1e6fdb2010-10-11 23:17:59 +000058 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()
Oscar Fuentesd2f4e5e2008-10-26 00:56:18 +000068endforeach( f )
69
Douglas Gregord1e6fdb2010-10-11 23:17:59 +000070add_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})
Oscar Fuentesa3f787c2011-02-20 22:06:44 +000086set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
Oscar Fuentesd2f4e5e2008-10-26 00:56:18 +000087
Douglas Gregorc302f002010-05-28 04:22:06 +000088install(FILES ${files} ${output_dir}/arm_neon.h
Oscar Fuentesd2f4e5e2008-10-26 00:56:18 +000089 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
Oscar Fuentes25950e82009-10-27 21:15:21 +000090 DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)