(library
 (name heap_libc)
 (wrapped false)
 (modules)
 (foreign_stubs
  (language c)
  (names hh_shared)
  (flags
   (:standard -I../../src/third-party/lz4 -I +unix)))
 (c_library_flags
  (:include heap_libc_flags.txt))
 (preprocess
  (pps ppx_deriving.std visitors.ppx))
 (libraries lz4 utils_core)
 (js_of_ocaml (javascript_files hh_shared.js)))

(rule
 (target heap_libc_flags.txt)
 (enabled_if
  (= %{system} "linux"))
 (action
  (with-stdout-to
   %{target}
   (echo "(-lrt)"))))

(rule
 (target heap_libc_flags.txt)
 (enabled_if
  (<> %{system} "linux"))
 (action
  (with-stdout-to
   %{target}
   (echo "()"))))

(library
 (name heap_ident)
 (wrapped false)
 (modules heapIdent)
 (libraries collections heap_libc)
 (preprocess
  (pps ppx_deriving.std visitors.ppx)))

(library
 (name heap_shared_mem)
 (wrapped false)
 (modules prefix sharedMem localCache)
 (preprocess
  (pps ppx_deriving.std visitors.ppx))
 (libraries
  flow_common_bitset
  common_lz4
  heap_libc
  leb128
  logging_common
  unix
  utils_core
  worker_cancel))

(library
 (name worker_cancel)
 (wrapped false)
 (modules workerCancel)
 (preprocess
  (pps ppx_deriving.std visitors.ppx))
 (libraries heap_libc utils_core))
