| 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 |
| Craig Topper | dec792e | 2011-12-19 05:04:33 +0000 | [diff] [blame] | 4 | avx2intrin.h |
| NAKAMURA Takumi | dceeeb8 | 2011-12-25 12:47:46 +0000 | [diff] [blame^] | 5 | bmiintrin.h |
| Oscar Fuentes | 6401523 | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 6 | emmintrin.h |
| 7 | float.h |
| Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 8 | immintrin.h |
| Oscar Fuentes | 6401523 | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 9 | iso646.h |
| 10 | limits.h |
| NAKAMURA Takumi | dceeeb8 | 2011-12-25 12:47:46 +0000 | [diff] [blame^] | 11 | lzcntintrin.h |
| Michael J. Spencer | 1737c9e | 2011-04-15 15:11:21 +0000 | [diff] [blame] | 12 | mm3dnow.h |
| Oscar Fuentes | 6401523 | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 13 | mmintrin.h |
| 14 | mm_malloc.h |
| 15 | nmmintrin.h |
| 16 | pmmintrin.h |
| Chris Lattner | 1b55b75 | 2010-08-20 17:24:02 +0000 | [diff] [blame] | 17 | smmintrin.h |
| Peter Collingbourne | 2f3cf4b | 2011-09-29 18:04:28 +0000 | [diff] [blame] | 18 | stdalign.h |
| Oscar Fuentes | 6401523 | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 19 | stdarg.h |
| 20 | stdbool.h |
| 21 | stddef.h |
| 22 | stdint.h |
| Douglas Gregor | e183993 | 2009-06-07 07:09:23 +0000 | [diff] [blame] | 23 | tgmath.h |
| 24 | tmmintrin.h |
| Oscar Fuentes | 6401523 | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 25 | varargs.h |
| 26 | wmmintrin.h |
| 27 | x86intrin.h |
| 28 | xmmintrin.h |
| Rafael Espindola | 488ea47 | 2011-12-06 15:46:47 +0000 | [diff] [blame] | 29 | cpuid.h |
| Rafael Espindola | 18c7920 | 2011-12-08 05:01:39 +0000 | [diff] [blame] | 30 | unwind.h |
| Oscar Fuentes | 6401523 | 2011-02-27 13:33:31 +0000 | [diff] [blame] | 31 | ) |
| Oscar Fuentes | 07d9f9a | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 32 | |
| Douglas Gregor | c4a8218 | 2010-10-19 18:06:10 +0000 | [diff] [blame] | 33 | set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include) |
| Douglas Gregor | bd82998 | 2010-10-11 23:17:59 +0000 | [diff] [blame] | 34 | |
| 35 | # If we are in an IDE that has a configuration directory, we need to |
| 36 | # create a second copy of the headers so that 'clang' can find them if |
| 37 | # it's run from the build directory. |
| 38 | if(MSVC_IDE OR XCODE) |
| 39 | set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include) |
| 40 | endif() |
| Douglas Gregor | 274a6b4 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 41 | |
| Douglas Gregor | 1f1be08 | 2010-05-28 04:22:06 +0000 | [diff] [blame] | 42 | # Generate arm_neon.h |
| Oscar Fuentes | 6f72540 | 2011-02-20 22:06:32 +0000 | [diff] [blame] | 43 | clang_tablegen(arm_neon.h.inc -gen-arm-neon |
| 44 | SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td) |
| Douglas Gregor | 1f1be08 | 2010-05-28 04:22:06 +0000 | [diff] [blame] | 45 | |
| Douglas Gregor | bd82998 | 2010-10-11 23:17:59 +0000 | [diff] [blame] | 46 | set(out_files) |
| Oscar Fuentes | 07d9f9a | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 47 | foreach( f ${files} ) |
| 48 | set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} ) |
| 49 | set( dst ${output_dir}/${f} ) |
| 50 | add_custom_command(OUTPUT ${dst} |
| 51 | DEPENDS ${src} |
| 52 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} |
| 53 | COMMENT "Copying clang's ${f}...") |
| Douglas Gregor | bd82998 | 2010-10-11 23:17:59 +0000 | [diff] [blame] | 54 | list(APPEND out_files ${dst}) |
| 55 | |
| 56 | if(other_output_dir) |
| 57 | set(other_dst ${other_output_dir}/${f}) |
| 58 | add_custom_command(OUTPUT ${other_dst} |
| 59 | DEPENDS ${src} |
| 60 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${other_dst} |
| 61 | COMMENT "Copying clang's ${f}...") |
| 62 | list(APPEND out_files ${other_dst}) |
| 63 | endif() |
| Oscar Fuentes | 07d9f9a | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 64 | endforeach( f ) |
| 65 | |
| Douglas Gregor | bd82998 | 2010-10-11 23:17:59 +0000 | [diff] [blame] | 66 | add_custom_command(OUTPUT ${output_dir}/arm_neon.h |
| 67 | DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc |
| 68 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc ${output_dir}/arm_neon.h |
| 69 | COMMENT "Copying clang's arm_neon.h...") |
| 70 | list(APPEND out_files ${output_dir}/arm_neon.h) |
| 71 | |
| 72 | if (other_output_dir) |
| 73 | set(other_dst ${other_output_dir}/arm_neon.h) |
| 74 | add_custom_command(OUTPUT ${other_dst} |
| 75 | DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc |
| 76 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc ${other_dst} |
| 77 | COMMENT "Copying clang's arm_neon.h...") |
| 78 | list(APPEND out_files ${other_dst}) |
| 79 | endif () |
| 80 | |
| 81 | add_custom_target(clang-headers ALL DEPENDS ${out_files}) |
| Oscar Fuentes | 15fe190 | 2011-02-20 22:06:44 +0000 | [diff] [blame] | 82 | set_target_properties(clang-headers PROPERTIES FOLDER "Misc") |
| Oscar Fuentes | 07d9f9a | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 83 | |
| Douglas Gregor | 1f1be08 | 2010-05-28 04:22:06 +0000 | [diff] [blame] | 84 | install(FILES ${files} ${output_dir}/arm_neon.h |
| Oscar Fuentes | 07d9f9a | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 85 | PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ |
| Oscar Fuentes | 843c828 | 2009-10-27 21:15:21 +0000 | [diff] [blame] | 86 | DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) |