Reimplementation of Pijul in C, for education, fun and absolutely no profit
project('ani', 'c',
  default_options : ['c_std=c11', 'b_sanitize=address']
)

add_project_arguments(
  '-g3',
  '-D_POSIX_C_SOURCE=200809L',
  # Extra flags from https://nullprogram.com/blog/2023/04/29/
  '-Wdouble-promotion',
  '-Wconversion',
  '-fsanitize-undefined-trap-on-error',
  '-fno-diagnostics-color',
  language: 'c'
)
libsrcs = [
  'vendor/zstdseek/zstdseek_compress.c',
  'vendor/zstdseek/zstdseek_decompress.c',
  'vendor/blake3/blake3.c',
  'vendor/blake3/blake3_dispatch.c',
  'vendor/blake3/blake3_portable.c',
  'base32.c',
  'bincode.c',
  'dir.c',
  'scaffold.c',
  'hash.c',
  'vertex.c',
  'atom.c',
  'hunk.c',
  'mbuf.c',
  'zstdseek.c',
  'blake3.c',
  'change.c',
  'db.c',
  'vendor/blake3/blake3_avx2_x86-64_unix.S',
  'vendor/blake3/blake3_avx512_x86-64_unix.S',
  'vendor/blake3/blake3_sse2_x86-64_unix.S',
  'vendor/blake3/blake3_sse41_x86-64_unix.S'
]
deps = [dependency('libzstd'), dependency('libxxhash')]
add_project_dependencies(deps, language: 'c')

lib = library('ani', sources : libsrcs, dependencies : deps)
exesrcs = [
  'ani.c',
  'init.c',
  'cmd-pristine.c',
]
executable('ani', sources : exesrcs, link_with : lib)
subdir('test')