project('wren', 'c')


cc = meson.get_compiler('c')
math = cc.find_library('m', required: false)


wren_src = files(
  'src/vm/wren_compiler.c',
  'src/vm/wren_core.c',
  'src/vm/wren_debug.c',
  'src/vm/wren_primitive.c',
  'src/vm/wren_utils.c',
  'src/vm/wren_value.c',
  'src/vm/wren_vm.c',
  'src/optional/wren_opt_meta.c',
  'src/optional/wren_opt_random.c',
)

wren_src_inc = include_directories(
  'src/vm',
  'src/optional',
)

wren_inc = include_directories(
  'src/include',
)

wren_lib = library(
  'wren',
  wren_src,
  include_directories: wren_src_inc,
  c_args: ['-DWREN_OPT_META', '-DWREN_OPT_RANDOM'],
  dependencies: [math],
)

wren = declare_dependency(
  link_with: [wren_lib],
  include_directories: wren_inc,
)
