• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1set(SANITIZER_HEADERS
2  sanitizer/allocator_interface.h
3  sanitizer/asan_interface.h
4  sanitizer/common_interface_defs.h
5  sanitizer/dfsan_interface.h
6  sanitizer/linux_syscall_hooks.h
7  sanitizer/lsan_interface.h
8  sanitizer/msan_interface.h
9  sanitizer/tsan_interface_atomic.h)
10
11set(output_dir ${COMPILER_RT_OUTPUT_DIR}/include)
12
13# Copy compiler-rt headers to the build tree.
14set(out_files)
15foreach( f ${SANITIZER_HEADERS} )
16  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
17  set( dst ${output_dir}/${f} )
18  add_custom_command(OUTPUT ${dst}
19    DEPENDS ${src}
20    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
21    COMMENT "Copying compiler-rt's ${f}...")
22  list(APPEND out_files ${dst})
23endforeach( f )
24
25add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files})
26add_dependencies(compiler-rt compiler-rt-headers)
27
28# Install sanitizer headers.
29install(FILES ${SANITIZER_HEADERS}
30  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
31  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer)
32