meson.build 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. project('cubes plus plus', 'cpp')
  2. src_common = [
  3. ]
  4. src_server = [
  5. 'server/Main.cpp',
  6. 'raw-terminal/Console.c',
  7. 'server/snuviscript/Snuvi.cpp',
  8. ]
  9. src_client = [
  10. 'client/Main.cpp',
  11. 'client/Controls.cpp',
  12. 'client/Network.cpp',
  13. 'client/World.cpp',
  14. 'client/Player.cpp',
  15. 'client/FontRenderer.cpp',
  16. 'client/Chat.cpp',
  17. ]
  18. sources_test = ['tests/Main.cpp']
  19. compiler = meson.get_compiler('cpp')
  20. args = compiler.get_supported_arguments(['-Wall', '-Wextra', '-pedantic', '-Werror', '-DLOG_LEVEL=4'])
  21. gamingcore_proj = subproject('gaming-core')
  22. gamingcore_dep = gamingcore_proj.get_variable('gamingcore_dep')
  23. common = static_library('common',
  24. sources: src_common,
  25. dependencies: [gamingcore_dep],
  26. cpp_args: args)
  27. common_dep = declare_dependency(
  28. link_with: common,
  29. include_directories: gamingcore_proj.get_variable('gamingcore_include'))
  30. if host_machine.system() == 'linux'
  31. liblonelytiger_proj = subproject('lonely-tiger')
  32. liblonelytiger_dep = liblonelytiger_proj.get_variable('liblonelytiger_dep')
  33. executable('game_server',
  34. sources: src_server,
  35. dependencies: [liblonelytiger_dep, common_dep],
  36. cpp_args: args)
  37. endif
  38. executable('game_tests',
  39. sources: sources_test,
  40. cpp_args: args)
  41. executable('game_client',
  42. sources: src_client,
  43. dependencies : common_dep,
  44. cpp_args: args)