blob: 3c58a82d050e008d40e9bc44a89c0e2d258b366f [file] [log] [blame]
Oscar Fuentes07d9f9a2008-10-26 00:56:18 +00001set(files
Chris Lattnerdad40622010-04-14 03:54:58 +00002 altivec.h
Benjamin Kramer1ab16ba2012-05-29 19:36:17 +00003 ammintrin.h
Bruno Cardoso Lopes7c4b5132010-08-04 22:03:36 +00004 avxintrin.h
Craig Topperdec792e2011-12-19 05:04:33 +00005 avx2intrin.h
NAKAMURA Takumidceeeb82011-12-25 12:47:46 +00006 bmiintrin.h
NAKAMURA Takumi9a3f2992011-12-26 03:20:06 +00007 bmi2intrin.h
Oscar Fuentes64015232011-02-27 13:33:31 +00008 emmintrin.h
9 float.h
NAKAMURA Takumi96d77daa2011-12-30 10:38:16 +000010 fma4intrin.h
Benjamin Kramer65b9f7b2010-08-20 18:04:07 +000011 immintrin.h
Oscar Fuentes64015232011-02-27 13:33:31 +000012 iso646.h
13 limits.h
NAKAMURA Takumidceeeb82011-12-25 12:47:46 +000014 lzcntintrin.h
Michael J. Spencer1737c9e2011-04-15 15:11:21 +000015 mm3dnow.h
Oscar Fuentes64015232011-02-27 13:33:31 +000016 mmintrin.h
17 mm_malloc.h
18 nmmintrin.h
19 pmmintrin.h
Richard Smith6b751dc2011-12-29 21:42:29 +000020 popcntintrin.h
Chris Lattner1b55b752010-08-20 17:24:02 +000021 smmintrin.h
Peter Collingbourne2f3cf4b2011-09-29 18:04:28 +000022 stdalign.h
Oscar Fuentes64015232011-02-27 13:33:31 +000023 stdarg.h
24 stdbool.h
25 stddef.h
26 stdint.h
Douglas Gregore1839932009-06-07 07:09:23 +000027 tgmath.h
28 tmmintrin.h
Oscar Fuentes64015232011-02-27 13:33:31 +000029 varargs.h
30 wmmintrin.h
31 x86intrin.h
32 xmmintrin.h
Rafael Espindola488ea472011-12-06 15:46:47 +000033 cpuid.h
Rafael Espindola18c79202011-12-08 05:01:39 +000034 unwind.h
Douglas Gregor3f09de62012-01-29 20:52:14 +000035 module.map
Oscar Fuentes64015232011-02-27 13:33:31 +000036 )
Oscar Fuentes07d9f9a2008-10-26 00:56:18 +000037
Douglas Gregorc4a82182010-10-19 18:06:10 +000038set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include)
Douglas Gregorbd829982010-10-11 23:17:59 +000039
40# If we are in an IDE that has a configuration directory, we need to
41# create a second copy of the headers so that 'clang' can find them if
42# it's run from the build directory.
43if(MSVC_IDE OR XCODE)
44 set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include)
45endif()
Douglas Gregor274a6b42009-06-16 20:13:51 +000046
Douglas Gregor1f1be082010-05-28 04:22:06 +000047# Generate arm_neon.h
Oscar Fuentes6f725402011-02-20 22:06:32 +000048clang_tablegen(arm_neon.h.inc -gen-arm-neon
49 SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
Douglas Gregor1f1be082010-05-28 04:22:06 +000050
Douglas Gregorbd829982010-10-11 23:17:59 +000051set(out_files)
Oscar Fuentes07d9f9a2008-10-26 00:56:18 +000052foreach( f ${files} )
53 set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
54 set( dst ${output_dir}/${f} )
55 add_custom_command(OUTPUT ${dst}
56 DEPENDS ${src}
57 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
58 COMMENT "Copying clang's ${f}...")
Douglas Gregorbd829982010-10-11 23:17:59 +000059 list(APPEND out_files ${dst})
60
61 if(other_output_dir)
62 set(other_dst ${other_output_dir}/${f})
63 add_custom_command(OUTPUT ${other_dst}
64 DEPENDS ${src}
65 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${other_dst}
66 COMMENT "Copying clang's ${f}...")
67 list(APPEND out_files ${other_dst})
68 endif()
Oscar Fuentes07d9f9a2008-10-26 00:56:18 +000069endforeach( f )
70
Douglas Gregorbd829982010-10-11 23:17:59 +000071add_custom_command(OUTPUT ${output_dir}/arm_neon.h
72 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc
73 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc ${output_dir}/arm_neon.h
74 COMMENT "Copying clang's arm_neon.h...")
75list(APPEND out_files ${output_dir}/arm_neon.h)
76
77if (other_output_dir)
78 set(other_dst ${other_output_dir}/arm_neon.h)
79 add_custom_command(OUTPUT ${other_dst}
80 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc
81 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc ${other_dst}
82 COMMENT "Copying clang's arm_neon.h...")
83 list(APPEND out_files ${other_dst})
84endif ()
85
86add_custom_target(clang-headers ALL DEPENDS ${out_files})
Oscar Fuentes15fe1902011-02-20 22:06:44 +000087set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
Oscar Fuentes07d9f9a2008-10-26 00:56:18 +000088
Douglas Gregor1f1be082010-05-28 04:22:06 +000089install(FILES ${files} ${output_dir}/arm_neon.h
Oscar Fuentes07d9f9a2008-10-26 00:56:18 +000090 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
Oscar Fuentes843c8282009-10-27 21:15:21 +000091 DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)