Alexey Samsonov | 2a529ad | 2013-04-11 15:49:52 +0000 | [diff] [blame] | 1 | set(SANITIZER_HEADERS |
| 2 | sanitizer/asan_interface.h |
| 3 | sanitizer/common_interface_defs.h |
Peter Collingbourne | eee71ae | 2013-08-07 22:47:26 +0000 | [diff] [blame] | 4 | sanitizer/dfsan_interface.h |
Alexey Samsonov | 2a529ad | 2013-04-11 15:49:52 +0000 | [diff] [blame] | 5 | sanitizer/linux_syscall_hooks.h |
Alexey Samsonov | 441a216 | 2013-06-14 11:45:36 +0000 | [diff] [blame] | 6 | sanitizer/lsan_interface.h |
Alexey Samsonov | 2a529ad | 2013-04-11 15:49:52 +0000 | [diff] [blame] | 7 | sanitizer/msan_interface.h) |
| 8 | |
| 9 | set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include) |
| 10 | |
| 11 | if(MSVC_IDE OR XCODE) |
| 12 | set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include) |
| 13 | endif() |
| 14 | |
| 15 | # Copy compiler-rt headers to the build tree. |
| 16 | set(out_files) |
| 17 | foreach( f ${SANITIZER_HEADERS} ) |
| 18 | set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} ) |
| 19 | set( dst ${output_dir}/${f} ) |
| 20 | add_custom_command(OUTPUT ${dst} |
| 21 | DEPENDS ${src} |
| 22 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} |
| 23 | COMMENT "Copying compiler-rt's ${f}...") |
| 24 | list(APPEND out_files ${dst}) |
| 25 | |
| 26 | if(other_output_dir) |
| 27 | set(other_dst ${other_output_dir}/${f}) |
| 28 | add_custom_command(OUTPUT ${other_dst} |
| 29 | DEPENDS ${src} |
| 30 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${other_dst} |
| 31 | COMMENT "Copying compiler-rt's ${f}...") |
| 32 | list(APPEND out_files ${other_dst}) |
| 33 | endif() |
| 34 | endforeach( f ) |
| 35 | |
| 36 | add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files}) |
| 37 | |
| 38 | # Install sanitizer headers. |
| 39 | install(FILES ${SANITIZER_HEADERS} |
| 40 | PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ |
| 41 | DESTINATION ${LIBCLANG_INSTALL_PATH}/include/sanitizer) |