blob: 771cfcd9f5f83c3f740353ff70751d9b574cb4b7 [file] [log] [blame]
Oscar Fuentes07d9f9a2008-10-26 00:56:18 +00001set(files
Chris Lattnerdad40622010-04-14 03:54:58 +00002 altivec.h
Bruno Cardoso Lopes7c4b5132010-08-04 22:03:36 +00003 avxintrin.h
Oscar Fuentes64015232011-02-27 13:33:31 +00004 emmintrin.h
5 float.h
Benjamin Kramer65b9f7b2010-08-20 18:04:07 +00006 immintrin.h
Oscar Fuentes64015232011-02-27 13:33:31 +00007 iso646.h
8 limits.h
Michael J. Spencer1737c9e2011-04-15 15:11:21 +00009 mm3dnow.h
Oscar Fuentes64015232011-02-27 13:33:31 +000010 mmintrin.h
11 mm_malloc.h
12 nmmintrin.h
13 pmmintrin.h
Chris Lattner1b55b752010-08-20 17:24:02 +000014 smmintrin.h
Peter Collingbourne2f3cf4b2011-09-29 18:04:28 +000015 stdalign.h
Oscar Fuentes64015232011-02-27 13:33:31 +000016 stdarg.h
17 stdbool.h
18 stddef.h
19 stdint.h
Douglas Gregore1839932009-06-07 07:09:23 +000020 tgmath.h
21 tmmintrin.h
Oscar Fuentes64015232011-02-27 13:33:31 +000022 varargs.h
23 wmmintrin.h
24 x86intrin.h
25 xmmintrin.h
Rafael Espindola488ea472011-12-06 15:46:47 +000026 cpuid.h
Oscar Fuentes64015232011-02-27 13:33:31 +000027 )
Oscar Fuentes07d9f9a2008-10-26 00:56:18 +000028
Douglas Gregorc4a82182010-10-19 18:06:10 +000029set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include)
Douglas Gregorbd829982010-10-11 23:17:59 +000030
31# If we are in an IDE that has a configuration directory, we need to
32# create a second copy of the headers so that 'clang' can find them if
33# it's run from the build directory.
34if(MSVC_IDE OR XCODE)
35 set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include)
36endif()
Douglas Gregor274a6b42009-06-16 20:13:51 +000037
Douglas Gregor1f1be082010-05-28 04:22:06 +000038# Generate arm_neon.h
Oscar Fuentes6f725402011-02-20 22:06:32 +000039clang_tablegen(arm_neon.h.inc -gen-arm-neon
40 SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
Douglas Gregor1f1be082010-05-28 04:22:06 +000041
Douglas Gregorbd829982010-10-11 23:17:59 +000042set(out_files)
Oscar Fuentes07d9f9a2008-10-26 00:56:18 +000043foreach( f ${files} )
44 set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
45 set( dst ${output_dir}/${f} )
46 add_custom_command(OUTPUT ${dst}
47 DEPENDS ${src}
48 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
49 COMMENT "Copying clang's ${f}...")
Douglas Gregorbd829982010-10-11 23:17:59 +000050 list(APPEND out_files ${dst})
51
52 if(other_output_dir)
53 set(other_dst ${other_output_dir}/${f})
54 add_custom_command(OUTPUT ${other_dst}
55 DEPENDS ${src}
56 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${other_dst}
57 COMMENT "Copying clang's ${f}...")
58 list(APPEND out_files ${other_dst})
59 endif()
Oscar Fuentes07d9f9a2008-10-26 00:56:18 +000060endforeach( f )
61
Douglas Gregorbd829982010-10-11 23:17:59 +000062add_custom_command(OUTPUT ${output_dir}/arm_neon.h
63 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc
64 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc ${output_dir}/arm_neon.h
65 COMMENT "Copying clang's arm_neon.h...")
66list(APPEND out_files ${output_dir}/arm_neon.h)
67
68if (other_output_dir)
69 set(other_dst ${other_output_dir}/arm_neon.h)
70 add_custom_command(OUTPUT ${other_dst}
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 ${other_dst}
73 COMMENT "Copying clang's arm_neon.h...")
74 list(APPEND out_files ${other_dst})
75endif ()
76
77add_custom_target(clang-headers ALL DEPENDS ${out_files})
Oscar Fuentes15fe1902011-02-20 22:06:44 +000078set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
Oscar Fuentes07d9f9a2008-10-26 00:56:18 +000079
Douglas Gregor1f1be082010-05-28 04:22:06 +000080install(FILES ${files} ${output_dir}/arm_neon.h
Oscar Fuentes07d9f9a2008-10-26 00:56:18 +000081 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
Oscar Fuentes843c8282009-10-27 21:15:21 +000082 DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)