meson.build 2.4 KB

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