function(ftxui_check_coverage library)
  if (FTXUI_ENABLE_COVERAGE)
    if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
      target_compile_options(${library} INTERFACE --coverage -O0 -g)
      target_link_libraries(${library} INTERFACE --coverage)
    endif()
  endif()
endfunction()
