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. 'lodepng/lodepng.cpp',
  33. ]
  34. src_tests = [
  35. 'Main.cpp',
  36. 'tests/ArrayListTests.cpp',
  37. 'tests/ArrayTests.cpp',
  38. 'tests/BitArrayTests.cpp',
  39. 'tests/BufferTests.cpp',
  40. 'tests/ClockTests.cpp',
  41. 'tests/ColorTests.cpp',
  42. 'tests/FrustumTests.cpp',
  43. 'tests/HashMapTests.cpp',
  44. 'tests/ListTests.cpp',
  45. 'tests/MatrixStackTests.cpp',
  46. 'tests/MatrixTests.cpp',
  47. 'tests/NetworkTests.cpp',
  48. 'tests/PNGReaderTests.cpp',
  49. 'tests/PlaneTests.cpp',
  50. 'tests/QuaternionTests.cpp',
  51. 'tests/RandomTests.cpp',
  52. 'tests/RingBufferTests.cpp',
  53. 'tests/SplitStringTests.cpp',
  54. 'tests/StackTests.cpp',
  55. 'tests/StringBufferTests.cpp',
  56. 'tests/Test.cpp',
  57. 'tests/TypedBufferTests.cpp',
  58. 'tests/UniquePointerTests.cpp',
  59. 'tests/UtilsTests.cpp',
  60. 'tests/VectorTests.cpp',
  61. 'tests/ComponentsTests.cpp',
  62. ]
  63. compiler = meson.get_compiler('cpp')
  64. args = compiler.get_supported_arguments(['-Wall', '-Wextra', '-pedantic', '-Werror'])
  65. thread_dep = dependency('threads')
  66. glew_dep = dependency('glew')
  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. glu_dep = compiler.find_library('glu32', required: false)
  72. libgamingcore_include = include_directories('.',
  73. glew_dep.get_pkgconfig_variable('includedir'),
  74. glfw_dep.get_pkgconfig_variable('includedir'))
  75. libgamingcore = static_library('gamingcore',
  76. sources: src,
  77. include_directories : libgamingcore_include,
  78. dependencies : [thread_dep, glew_dep, glfw_dep, gl_dep, ws2_32_dep, winmm_dep, glu_dep],
  79. cpp_args: args)
  80. libgamingcore_dep = declare_dependency(
  81. include_directories: libgamingcore_include,
  82. link_with: libgamingcore)
  83. executable('tests',
  84. sources: src_tests,
  85. dependencies : libgamingcore_dep,
  86. cpp_args: args + ['-DLOG_LEVEL=4'])