meson.build 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. project('lonelytiger', 'c')
  2. src = [
  3. 'tokenizer/Tokenizer.c',
  4. 'tokenizer/Token.c',
  5. 'tokenizer/FileTokens.c',
  6. 'utils/SnuviUtils.c',
  7. 'utils/Variables.c',
  8. 'utils/Functions.c',
  9. 'utils/ByteCodePrinter.c',
  10. 'Compiler.c',
  11. 'DataType.c',
  12. 'Error.c',
  13. 'Test.c',
  14. 'vm/ByteCode.c',
  15. 'vm/Script.c',
  16. 'vm/Arrays.c',
  17. 'libraries/Time.c',
  18. 'libraries/Math.c'
  19. ]
  20. cc = meson.get_compiler('c')
  21. math_dep = cc.find_library('m', required : true)
  22. args = cc.get_supported_arguments([
  23. '-Werror', '-pedantic', '-pedantic-errors', '-Wall', '-Wextra', '-Wdouble-promotion',
  24. '-Wformat=2', '-Wformat-signedness', '-Wnull-dereference', '-Winfinite-recursion',
  25. '-Winit-self', '-Wmissing-include-dirs', '-Wshift-overflow=2', '-Wtrivial-auto-var-init',
  26. '-Wduplicated-branches', '-Wduplicated-cond', '-Wfloat-equal', '-Wshadow', '-Wundef',
  27. '-Wcast-qual', '-Wcast-align=strict', '-Wconversion', '-Warith-conversion',
  28. '-Wsign-conversion', '-Wlogical-op', '-Wmissing-declarations', '-Wpadded',
  29. '-Woverlength-strings', '-Wwrite-strings', '-Walloca', '-Walloc-zero', '-Wdate-time',
  30. '-Wc++-compat', '-Wdisabled-optimization', '-Winvalid-pch', '-Wmultichar',
  31. '-Wbidi-chars=any', '-Wbad-function-cast', '-Wjump-misses-init', '-Wstrict-prototypes',
  32. '-Wmissing-prototypes', '-Wnested-externs', '-Wunsuffixed-float-constants', '-Wredundant-decls'
  33. ])
  34. inc = include_directories('.')
  35. liblonelytiger = static_library('lonelytiger',
  36. sources: src,
  37. include_directories : inc,
  38. dependencies : math_dep,
  39. c_args: args)
  40. liblonelytiger_dep = declare_dependency(include_directories : inc, link_with : liblonelytiger)
  41. executable('tests',
  42. sources: src + ['Main.c'],
  43. dependencies : math_dep,
  44. c_args: args)