meson.build 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. project('gamingcore', 'cpp')
  2. src = [
  3. 'images/PNGReader.cpp',
  4. 'input/Button.cpp',
  5. 'input/Buttons.cpp',
  6. 'input/TextInput.cpp',
  7. 'math/Frustum.cpp',
  8. 'math/Matrix.cpp',
  9. 'math/Plane.cpp',
  10. 'math/Quaternion.cpp',
  11. 'math/Vector.cpp',
  12. 'network/Client.cpp',
  13. 'network/ENet.cpp',
  14. 'network/Packet.cpp',
  15. 'network/Server.cpp',
  16. 'rendering/Attributes.cpp',
  17. 'rendering/FileTexture.cpp',
  18. 'rendering/Shader.cpp',
  19. 'rendering/Texture.cpp',
  20. 'rendering/TextureFormat.cpp',
  21. 'rendering/VertexBuffer.cpp',
  22. 'rendering/Window.cpp',
  23. 'rendering/WindowOptions.cpp',
  24. 'utils/BitArray.cpp',
  25. 'utils/Buffer.cpp',
  26. 'utils/Clock.cpp',
  27. 'utils/Error.cpp',
  28. 'utils/Logger.cpp',
  29. 'utils/Random.cpp',
  30. 'utils/Size.cpp',
  31. 'wrapper/GL.cpp',
  32. ]
  33. src_tests = [
  34. 'Main.cpp',
  35. 'tests/ArrayListTests.cpp',
  36. 'tests/ArrayTests.cpp',
  37. 'tests/BitArrayTests.cpp',
  38. 'tests/BufferTests.cpp',
  39. 'tests/ClockTests.cpp',
  40. 'tests/ColorTests.cpp',
  41. 'tests/FrustumTests.cpp',
  42. 'tests/HashMapTests.cpp',
  43. 'tests/ListTests.cpp',
  44. 'tests/MatrixStackTests.cpp',
  45. 'tests/MatrixTests.cpp',
  46. 'tests/NetworkTests.cpp',
  47. 'tests/PNGReaderTests.cpp',
  48. 'tests/PlaneTests.cpp',
  49. 'tests/QuaternionTests.cpp',
  50. 'tests/RandomTests.cpp',
  51. 'tests/RingBufferTests.cpp',
  52. 'tests/SplitStringTests.cpp',
  53. 'tests/StackTests.cpp',
  54. 'tests/StringBufferTests.cpp',
  55. 'tests/Test.cpp',
  56. 'tests/TypedBufferTests.cpp',
  57. 'tests/UniquePointerTests.cpp',
  58. 'tests/UtilsTests.cpp',
  59. 'tests/VectorTests.cpp',
  60. ]
  61. compiler = meson.get_compiler('cpp')
  62. args = compiler.get_supported_arguments(['-Wall', '-Wextra', '-pedantic', '-Werror'])
  63. thread_dep = dependency('threads')
  64. glew_dep = dependency('glew')
  65. zlib_dep = dependency('zlib')
  66. png_dep = dependency('libpng')
  67. glfw_dep = dependency('glfw3')
  68. gl_dep = dependency('GL')
  69. ws2_32_dep = compiler.find_library('ws2_32', required: false)
  70. winmm_dep = compiler.find_library('winmm', required: false)
  71. inc = include_directories('.',
  72. glew_dep.get_pkgconfig_variable('includedir'),
  73. glfw_dep.get_pkgconfig_variable('includedir'),
  74. png_dep.get_pkgconfig_variable('includedir'))
  75. libgamingcore = static_library('gamingcore',
  76. sources: src,
  77. include_directories : inc,
  78. dependencies : [thread_dep, glew_dep, glfw_dep, png_dep, zlib_dep, gl_dep, ws2_32_dep, winmm_dep],
  79. cpp_args: args)
  80. libgamingcore_dep = declare_dependency(
  81. include_directories: inc,
  82. link_with: libgamingcore)
  83. executable('tests',
  84. sources: src_tests,
  85. dependencies : libgamingcore_dep,
  86. cpp_args: args + ['-DLOG_LEVEL=4'])