meson.build 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. project('cubes plus plus', 'cpp')
  2. src_common = [
  3. 'common/Block.cpp',
  4. 'common/BlockStorage.cpp',
  5. 'common/Box.cpp',
  6. 'common/entities/Entity.cpp',
  7. 'common/network/toserver/PlayerUpdatePacket.cpp',
  8. 'common/network/toclient/EntityUpdatePacket.cpp',
  9. ]
  10. src_server = ['server/Main.cpp',
  11. 'server/Game.cpp',
  12. 'server/World.cpp',
  13. 'server/commands/Commands.cpp',
  14. 'server/commands/DefaultCommands.cpp',
  15. 'server/commands/SnuviCommands.cpp',
  16. 'server/snuviscript/Snuvi.cpp',
  17. 'server/GameServer.cpp',
  18. 'server/entities/ServerPlayer.cpp',
  19. 'server/packets/WorldPackets.cpp',
  20. ]
  21. src_client = ['client/Main.cpp',
  22. 'client/rendering/Engine.cpp',
  23. 'client/rendering/Mesh.cpp',
  24. 'client/Game.cpp',
  25. 'client/GameClient.cpp',
  26. 'client/World.cpp',
  27. 'client/rendering/ShaderMatrix.cpp',
  28. 'client/input/Controller.cpp',
  29. 'client/rendering/Renderer.cpp',
  30. 'client/gui/BaseGUI.cpp',
  31. 'client/gui/StartGUI.cpp',
  32. 'client/packets/WorldPackets.cpp',
  33. ]
  34. sources_test = ['tests/Main.cpp']
  35. compiler = meson.get_compiler('cpp')
  36. args = compiler.get_supported_arguments(['-Wall', '-Wextra', '-pedantic', '-Werror', '-DLOG_LEVEL=4'])
  37. libgamingcore_proj = subproject('gaming-core')
  38. libgamingcore_dep = libgamingcore_proj.get_variable('libgamingcore_dep')
  39. common = static_library('common',
  40. sources: src_common,
  41. dependencies: [libgamingcore_dep],
  42. cpp_args: args)
  43. common_dep = declare_dependency(
  44. link_with: common,
  45. include_directories: libgamingcore_proj.get_variable('libgamingcore_include'))
  46. if host_machine.system() == 'linux'
  47. liblonelytiger_proj = subproject('lonely-tiger')
  48. liblonelytiger_dep = liblonelytiger_proj.get_variable('liblonelytiger_dep')
  49. executable('game_server',
  50. sources: src_server,
  51. dependencies: [liblonelytiger_dep, common_dep],
  52. cpp_args: args)
  53. endif
  54. executable('game_tests',
  55. sources: sources_test,
  56. cpp_args: args)
  57. executable('game_client',
  58. sources: src_client,
  59. dependencies : common_dep,
  60. cpp_args: args)