Oscar Fuentes | d2f4e5e | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 1 | set(files |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2 | altivec.h |
Bruno Cardoso Lopes | 55db5b8 | 2010-08-04 22:03:36 +0000 | [diff] [blame] | 3 | avxintrin.h |
Oscar Fuentes | be7025e | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 4 | emmintrin.h |
| 5 | float.h |
Benjamin Kramer | 033b7b3 | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 6 | immintrin.h |
Oscar Fuentes | be7025e | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 7 | iso646.h |
| 8 | limits.h |
Michael J. Spencer | 408d5d1 | 2011-04-15 15:11:21 +0000 | [diff] [blame^] | 9 | mm3dnow.h |
Oscar Fuentes | be7025e | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 10 | mmintrin.h |
| 11 | mm_malloc.h |
| 12 | nmmintrin.h |
| 13 | pmmintrin.h |
Chris Lattner | 3a70f86 | 2010-08-20 17:24:02 +0000 | [diff] [blame] | 14 | smmintrin.h |
Oscar Fuentes | be7025e | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 15 | stdarg.h |
| 16 | stdbool.h |
| 17 | stddef.h |
| 18 | stdint.h |
Douglas Gregor | 0602600 | 2009-06-07 07:09:23 +0000 | [diff] [blame] | 19 | tgmath.h |
| 20 | tmmintrin.h |
Oscar Fuentes | be7025e | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 21 | varargs.h |
| 22 | wmmintrin.h |
| 23 | x86intrin.h |
| 24 | xmmintrin.h |
| 25 | ) |
Oscar Fuentes | d2f4e5e | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 26 | |
Douglas Gregor | 105716e | 2010-10-19 18:06:10 +0000 | [diff] [blame] | 27 | set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include) |
Douglas Gregor | d1e6fdb | 2010-10-11 23:17:59 +0000 | [diff] [blame] | 28 | |
| 29 | # If we are in an IDE that has a configuration directory, we need to |
| 30 | # create a second copy of the headers so that 'clang' can find them if |
| 31 | # it's run from the build directory. |
| 32 | if(MSVC_IDE OR XCODE) |
| 33 | set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include) |
| 34 | endif() |
Douglas Gregor | ebfc180 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 35 | |
Douglas Gregor | c302f00 | 2010-05-28 04:22:06 +0000 | [diff] [blame] | 36 | # Generate arm_neon.h |
Oscar Fuentes | c8da1ec | 2011-02-20 22:06:32 +0000 | [diff] [blame] | 37 | clang_tablegen(arm_neon.h.inc -gen-arm-neon |
| 38 | SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td) |
Douglas Gregor | c302f00 | 2010-05-28 04:22:06 +0000 | [diff] [blame] | 39 | |
Douglas Gregor | d1e6fdb | 2010-10-11 23:17:59 +0000 | [diff] [blame] | 40 | set(out_files) |
Oscar Fuentes | d2f4e5e | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 41 | foreach( f ${files} ) |
| 42 | set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} ) |
| 43 | set( dst ${output_dir}/${f} ) |
| 44 | add_custom_command(OUTPUT ${dst} |
| 45 | DEPENDS ${src} |
| 46 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} |
| 47 | COMMENT "Copying clang's ${f}...") |
Douglas Gregor | d1e6fdb | 2010-10-11 23:17:59 +0000 | [diff] [blame] | 48 | list(APPEND out_files ${dst}) |
| 49 | |
| 50 | if(other_output_dir) |
| 51 | set(other_dst ${other_output_dir}/${f}) |
| 52 | add_custom_command(OUTPUT ${other_dst} |
| 53 | DEPENDS ${src} |
| 54 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${other_dst} |
| 55 | COMMENT "Copying clang's ${f}...") |
| 56 | list(APPEND out_files ${other_dst}) |
| 57 | endif() |
Oscar Fuentes | d2f4e5e | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 58 | endforeach( f ) |
| 59 | |
Douglas Gregor | d1e6fdb | 2010-10-11 23:17:59 +0000 | [diff] [blame] | 60 | add_custom_command(OUTPUT ${output_dir}/arm_neon.h |
| 61 | DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc |
| 62 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc ${output_dir}/arm_neon.h |
| 63 | COMMENT "Copying clang's arm_neon.h...") |
| 64 | list(APPEND out_files ${output_dir}/arm_neon.h) |
| 65 | |
| 66 | if (other_output_dir) |
| 67 | set(other_dst ${other_output_dir}/arm_neon.h) |
| 68 | add_custom_command(OUTPUT ${other_dst} |
| 69 | DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc |
| 70 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc ${other_dst} |
| 71 | COMMENT "Copying clang's arm_neon.h...") |
| 72 | list(APPEND out_files ${other_dst}) |
| 73 | endif () |
| 74 | |
| 75 | add_custom_target(clang-headers ALL DEPENDS ${out_files}) |
Oscar Fuentes | a3f787c | 2011-02-20 22:06:44 +0000 | [diff] [blame] | 76 | set_target_properties(clang-headers PROPERTIES FOLDER "Misc") |
Oscar Fuentes | d2f4e5e | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 77 | |
Douglas Gregor | c302f00 | 2010-05-28 04:22:06 +0000 | [diff] [blame] | 78 | install(FILES ${files} ${output_dir}/arm_neon.h |
Oscar Fuentes | d2f4e5e | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 79 | PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ |
Oscar Fuentes | 25950e8 | 2009-10-27 21:15:21 +0000 | [diff] [blame] | 80 | DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) |