| Oscar Fuentes | 07d9f9a | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 1 | set(files |
| Chris Lattner | dad4062 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2 | altivec.h |
| Bruno Cardoso Lopes | 7c4b513 | 2010-08-04 22:03:36 +0000 | [diff] [blame] | 3 | avxintrin.h |
| Oscar Fuentes | 6401523 | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 4 | emmintrin.h |
| 5 | float.h |
| Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 6 | immintrin.h |
| Oscar Fuentes | 6401523 | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 7 | iso646.h |
| 8 | limits.h |
| Michael J. Spencer | 1737c9e | 2011-04-15 15:11:21 +0000 | [diff] [blame] | 9 | mm3dnow.h |
| Oscar Fuentes | 6401523 | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 10 | mmintrin.h |
| 11 | mm_malloc.h |
| 12 | nmmintrin.h |
| 13 | pmmintrin.h |
| Chris Lattner | 1b55b75 | 2010-08-20 17:24:02 +0000 | [diff] [blame] | 14 | smmintrin.h |
| Peter Collingbourne | 2f3cf4b | 2011-09-29 18:04:28 +0000 | [diff] [blame] | 15 | stdalign.h |
| Oscar Fuentes | 6401523 | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 16 | stdarg.h |
| 17 | stdbool.h |
| 18 | stddef.h |
| 19 | stdint.h |
| Douglas Gregor | e183993 | 2009-06-07 07:09:23 +0000 | [diff] [blame] | 20 | tgmath.h |
| 21 | tmmintrin.h |
| Oscar Fuentes | 6401523 | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 22 | varargs.h |
| 23 | wmmintrin.h |
| 24 | x86intrin.h |
| 25 | xmmintrin.h |
| Rafael Espindola | 488ea47 | 2011-12-06 15:46:47 +0000 | [diff] [blame^] | 26 | cpuid.h |
| Oscar Fuentes | 6401523 | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 27 | ) |
| Oscar Fuentes | 07d9f9a | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 28 | |
| Douglas Gregor | c4a8218 | 2010-10-19 18:06:10 +0000 | [diff] [blame] | 29 | set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include) |
| Douglas Gregor | bd82998 | 2010-10-11 23:17:59 +0000 | [diff] [blame] | 30 | |
| 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. |
| 34 | if(MSVC_IDE OR XCODE) |
| 35 | set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include) |
| 36 | endif() |
| Douglas Gregor | 274a6b4 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 37 | |
| Douglas Gregor | 1f1be08 | 2010-05-28 04:22:06 +0000 | [diff] [blame] | 38 | # Generate arm_neon.h |
| Oscar Fuentes | 6f72540 | 2011-02-20 22:06:32 +0000 | [diff] [blame] | 39 | clang_tablegen(arm_neon.h.inc -gen-arm-neon |
| 40 | SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td) |
| Douglas Gregor | 1f1be08 | 2010-05-28 04:22:06 +0000 | [diff] [blame] | 41 | |
| Douglas Gregor | bd82998 | 2010-10-11 23:17:59 +0000 | [diff] [blame] | 42 | set(out_files) |
| Oscar Fuentes | 07d9f9a | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 43 | foreach( 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 Gregor | bd82998 | 2010-10-11 23:17:59 +0000 | [diff] [blame] | 50 | 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 Fuentes | 07d9f9a | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 60 | endforeach( f ) |
| 61 | |
| Douglas Gregor | bd82998 | 2010-10-11 23:17:59 +0000 | [diff] [blame] | 62 | add_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...") |
| 66 | list(APPEND out_files ${output_dir}/arm_neon.h) |
| 67 | |
| 68 | if (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}) |
| 75 | endif () |
| 76 | |
| 77 | add_custom_target(clang-headers ALL DEPENDS ${out_files}) |
| Oscar Fuentes | 15fe190 | 2011-02-20 22:06:44 +0000 | [diff] [blame] | 78 | set_target_properties(clang-headers PROPERTIES FOLDER "Misc") |
| Oscar Fuentes | 07d9f9a | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 79 | |
| Douglas Gregor | 1f1be08 | 2010-05-28 04:22:06 +0000 | [diff] [blame] | 80 | install(FILES ${files} ${output_dir}/arm_neon.h |
| Oscar Fuentes | 07d9f9a | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 81 | PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ |
| Oscar Fuentes | 843c828 | 2009-10-27 21:15:21 +0000 | [diff] [blame] | 82 | DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) |