(library
 (name swresample)
 (public_name ffmpeg-swresample)
 (synopsis "Bindings to ffmpeg's swresample library")
 (foreign_stubs
  (language c)
  (names swresample_stubs)
  (flags
   (:include c_flags.sexp)))
 (c_library_flags
  (:include c_library_flags.sexp))
 (libraries ffmpeg-avutil ffmpeg-avcodec))

(rule
 (targets c_flags c_flags.sexp c_library_flags.sexp)
 (action
  (run ./config/discover.exe)))

(rule
 (targets swresample_stubs.c)
 (mode fallback)
 (deps swresample_options_stubs.h)
 (action
  (echo "this should not happen")))

(rule
 (targets swresample_options_stubs.h)
 (deps c_flags)
 (action
  (run
   ../gen_code/gen_code.exe
   "%{cc}"
   swresample_options
   h
   %{read-lines:c_flags})))

(rule
 (targets swresample_options.ml)
 (deps c_flags)
 (action
  (run
   ../gen_code/gen_code.exe
   "%{cc}"
   swresample_options
   ml
   %{read-lines:c_flags})))
