Home | History | Annotate | Download | only in include
      1 set(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/linux_syscall_hooks.h
      8   sanitizer/lsan_interface.h
      9   sanitizer/msan_interface.h
     10   sanitizer/tsan_interface_atomic.h)
     11 
     12 set(output_dir ${COMPILER_RT_OUTPUT_DIR}/include)
     13 
     14 # Copy compiler-rt headers to the build tree.
     15 set(out_files)
     16 foreach( f ${SANITIZER_HEADERS} )
     17   set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
     18   set( dst ${output_dir}/${f} )
     19   add_custom_command(OUTPUT ${dst}
     20     DEPENDS ${src}
     21     COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
     22     COMMENT "Copying compiler-rt's ${f}...")
     23   list(APPEND out_files ${dst})
     24 endforeach( f )
     25 
     26 add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files})
     27 add_dependencies(compiler-rt compiler-rt-headers)
     28 
     29 # Install sanitizer headers.
     30 install(FILES ${SANITIZER_HEADERS}
     31   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
     32   DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer)
     33