meson.build 2.3 KB

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