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/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 
     11 set(output_dir ${COMPILER_RT_OUTPUT_DIR}/include)
     12 
     13 # Copy compiler-rt headers to the build tree.
     14 set(out_files)
     15 foreach( 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})
     23 endforeach( f )
     24 
     25 add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files})
     26 add_dependencies(compiler-rt compiler-rt-headers)
     27 
     28 # Install sanitizer headers.
     29 install(FILES ${SANITIZER_HEADERS}
     30   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
     31   DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer)
     32