(library
 (name bap_ida_plugin)
 (public_name bap-ida.plugin)
 (preprocess (pps ppx_bap))
 (libraries
   bap
   bap-future
   bap-ida
   bap-knowledge
   core_kernel
   core_kernel.caml_unix
   fileutils
   graphlib
   mmap
   regular
   re.posix))

(plugin
 (name ida)
 (package bap-ida)
 (libraries bap-ida.plugin)
 (site (bap-common plugins)))

(rule
 (target bap_ida_config.ml)
 (deps bap_ida_config.ml.ab (alias ../../config))
 (action
  (with-stdin-from %{deps}
   (with-stdout-to %{target}
    (chdir %{workspace_root}
     (run ./tools/rewrite.exe -filename %{deps}))))))
