diff options
author | Zancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au> | 2012-09-24 09:58:17 +1000 |
---|---|---|
committer | Zancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au> | 2012-09-24 09:58:17 +1000 |
commit | 222e2a7620e6520ffaf4fc4e69d79c18da31542e (patch) | |
tree | 7bfbc05bfa3b41c8f9d2e56d53a0bc3e310df239 /clang/lib/Headers/CMakeLists.txt | |
parent | 3d206f03985b50beacae843d880bccdc91a9f424 (diff) |
Add the clang library to the repo (with some of my changes, too).
Diffstat (limited to 'clang/lib/Headers/CMakeLists.txt')
-rw-r--r-- | clang/lib/Headers/CMakeLists.txt | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt new file mode 100644 index 0000000..78141a3 --- /dev/null +++ b/clang/lib/Headers/CMakeLists.txt @@ -0,0 +1,90 @@ +set(files + altivec.h + avxintrin.h + avx2intrin.h + bmiintrin.h + bmi2intrin.h + emmintrin.h + float.h + fma4intrin.h + immintrin.h + iso646.h + limits.h + lzcntintrin.h + mm3dnow.h + mmintrin.h + mm_malloc.h + nmmintrin.h + pmmintrin.h + popcntintrin.h + smmintrin.h + stdalign.h + stdarg.h + stdbool.h + stddef.h + stdint.h + tgmath.h + tmmintrin.h + varargs.h + wmmintrin.h + x86intrin.h + xmmintrin.h + cpuid.h + unwind.h + module.map + ) + +set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include) + +# If we are in an IDE that has a configuration directory, we need to +# create a second copy of the headers so that 'clang' can find them if +# it's run from the build directory. +if(MSVC_IDE OR XCODE) + set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include) +endif() + +# Generate arm_neon.h +clang_tablegen(arm_neon.h.inc -gen-arm-neon + SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td) + +set(out_files) +foreach( f ${files} ) + set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} ) + set( dst ${output_dir}/${f} ) + add_custom_command(OUTPUT ${dst} + DEPENDS ${src} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} + COMMENT "Copying clang's ${f}...") + list(APPEND out_files ${dst}) + + if(other_output_dir) + set(other_dst ${other_output_dir}/${f}) + add_custom_command(OUTPUT ${other_dst} + DEPENDS ${src} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${other_dst} + COMMENT "Copying clang's ${f}...") + list(APPEND out_files ${other_dst}) + endif() +endforeach( f ) + +add_custom_command(OUTPUT ${output_dir}/arm_neon.h + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc ${output_dir}/arm_neon.h + COMMENT "Copying clang's arm_neon.h...") +list(APPEND out_files ${output_dir}/arm_neon.h) + +if (other_output_dir) + set(other_dst ${other_output_dir}/arm_neon.h) + add_custom_command(OUTPUT ${other_dst} + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc ${other_dst} + COMMENT "Copying clang's arm_neon.h...") + list(APPEND out_files ${other_dst}) +endif () + +add_custom_target(clang-headers ALL DEPENDS ${out_files}) +set_target_properties(clang-headers PROPERTIES FOLDER "Misc") + +install(FILES ${files} ${output_dir}/arm_neon.h + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) |