(copy_files# ../watchercommon.ml{,i})

(library
 (name fswatcher_linux)
 (wrapped false)
 (enabled_if
  (or
   (= %{system} "linux")
   (= %{system} "linux_elf")
   (= %{system} "elf")
   (= %{system} "linux_eabihf")
   (= %{system} "linux_eabi")))
 (modules :standard \ watcher)
 (flags :standard -w -3-27)
 (foreign_stubs
  (language c)
  (names inotify_stubs))
 (libraries unix lwt_lib))

(executable
 (name watcher)
 (public_name unison-fsmonitor)
 (package unison-fsmonitor)
 (enabled_if
  (or
   (= %{system} "linux")
   (= %{system} "linux_elf")
   (= %{system} "elf")
   (= %{system} "linux_eabihf")
   (= %{system} "linux_eabi")))
 (modules watcher)
 (flags :standard -w -27)
 (libraries fswatcher_linux))
