• 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/coverage_interface.h
6  sanitizer/dfsan_interface.h
7  sanitizer/esan_interface.h
8  sanitizer/linux_syscall_hooks.h
9  sanitizer/lsan_interface.h
10  sanitizer/msan_interface.h
11  sanitizer/tsan_interface_atomic.h)
12
13set(output_dir ${COMPILER_RT_OUTPUT_DIR}/include)
14
15# Copy compiler-rt headers to the build tree.
16set(out_files)
17foreach( 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})
25endforeach( f )
26
27add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files})
28add_dependencies(compiler-rt compiler-rt-headers)
29set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc")
30
31# Install sanitizer headers.
32install(FILES ${SANITIZER_HEADERS}
33  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
34  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer)
35