meson.build 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. project('cubes plus plus', 'cpp')
  2. src_common = [
  3. 'common/Packets.cpp',
  4. 'common/Box.cpp',
  5. ]
  6. src_server = [
  7. 'server/Main.cpp',
  8. 'raw-terminal/Console.c',
  9. 'server/snuviscript/Snuvi.cpp',
  10. ]
  11. src_client = [
  12. 'client/Main.cpp',
  13. ]
  14. sources_test = ['tests/Main.cpp']
  15. compiler = meson.get_compiler('cpp')
  16. args = compiler.get_supported_arguments(['-Wall', '-Wextra', '-pedantic', '-Werror', '-DLOG_LEVEL=4'])
  17. gamingcore_proj = subproject('gaming-core')
  18. gamingcore_dep = gamingcore_proj.get_variable('gamingcore_dep')
  19. common = static_library('common',
  20. sources: src_common,
  21. dependencies: [gamingcore_dep],
  22. cpp_args: args)
  23. common_dep = declare_dependency(
  24. link_with: common,
  25. include_directories: gamingcore_proj.get_variable('gamingcore_include'))
  26. if host_machine.system() == 'linux'
  27. liblonelytiger_proj = subproject('lonely-tiger')
  28. liblonelytiger_dep = liblonelytiger_proj.get_variable('liblonelytiger_dep')
  29. executable('game_server',
  30. sources: src_server,
  31. dependencies: [liblonelytiger_dep, common_dep],
  32. cpp_args: args)
  33. endif
  34. executable('game_tests',
  35. sources: sources_test,
  36. cpp_args: args)
  37. executable('game_client',
  38. sources: src_client,
  39. dependencies : common_dep,
  40. cpp_args: args)