meson.build 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. ]
  16. sources_test = ['tests/Main.cpp']
  17. compiler = meson.get_compiler('cpp')
  18. args = compiler.get_supported_arguments(['-Wall', '-Wextra', '-pedantic', '-Werror', '-DLOG_LEVEL=4'])
  19. gamingcore_proj = subproject('gaming-core')
  20. gamingcore_dep = gamingcore_proj.get_variable('gamingcore_dep')
  21. common = static_library('common',
  22. sources: src_common,
  23. dependencies: [gamingcore_dep],
  24. cpp_args: args)
  25. common_dep = declare_dependency(
  26. link_with: common,
  27. include_directories: gamingcore_proj.get_variable('gamingcore_include'))
  28. if host_machine.system() == 'linux'
  29. liblonelytiger_proj = subproject('lonely-tiger')
  30. liblonelytiger_dep = liblonelytiger_proj.get_variable('liblonelytiger_dep')
  31. executable('game_server',
  32. sources: src_server,
  33. dependencies: [liblonelytiger_dep, common_dep],
  34. cpp_args: args)
  35. endif
  36. executable('game_tests',
  37. sources: sources_test,
  38. cpp_args: args)
  39. executable('game_client',
  40. sources: src_client,
  41. dependencies : common_dep,
  42. cpp_args: args)