meson.build 2.3 KB

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