meson.build 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. project('gamingcore', 'cpp')
  2. src = [
  3. 'images/ImageReader.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. 'GL/glew.c'
  34. ]
  35. src_tests = [
  36. 'Main.cpp',
  37. 'tests/ArrayListTests.cpp',
  38. 'tests/ArrayTests.cpp',
  39. 'tests/BitArrayTests.cpp',
  40. 'tests/BufferTests.cpp',
  41. 'tests/ClockTests.cpp',
  42. 'tests/ColorTests.cpp',
  43. 'tests/FrustumTests.cpp',
  44. 'tests/HashMapTests.cpp',
  45. 'tests/ListTests.cpp',
  46. 'tests/MatrixStackTests.cpp',
  47. 'tests/MatrixTests.cpp',
  48. 'tests/NetworkTests.cpp',
  49. 'tests/ImageReaderTests.cpp',
  50. 'tests/PlaneTests.cpp',
  51. 'tests/QuaternionTests.cpp',
  52. 'tests/RandomTests.cpp',
  53. 'tests/RingBufferTests.cpp',
  54. 'tests/SplitStringTests.cpp',
  55. 'tests/StackTests.cpp',
  56. 'tests/StringBufferTests.cpp',
  57. 'tests/Test.cpp',
  58. 'tests/TypedBufferTests.cpp',
  59. 'tests/UniquePointerTests.cpp',
  60. 'tests/UtilsTests.cpp',
  61. 'tests/VectorTests.cpp',
  62. 'tests/ComponentsTests.cpp',
  63. ]
  64. compiler = meson.get_compiler('cpp')
  65. args = compiler.get_supported_arguments(['-Wall', '-Wextra', '-pedantic', '-Werror'])
  66. cmake = import('cmake')
  67. glfw_proj = cmake.subproject('glfw')
  68. glfw_dep = glfw_proj.dependency('glfw')
  69. thread_dep = dependency('threads', static: true)
  70. gl_dep = dependency('GL')
  71. ws2_32_dep = compiler.find_library('ws2_32', required: false)
  72. winmm_dep = compiler.find_library('winmm', required: false)
  73. glu_dep = compiler.find_library('glu32', required: false)
  74. dl_dep = compiler.find_library('dl', required: false)
  75. glu_dep = compiler.find_library('GLU', required: false)
  76. libgamingcore_include = include_directories('.', 'subprojects/glfw/include')
  77. libgamingcore = static_library('gamingcore',
  78. sources: src,
  79. include_directories : libgamingcore_include,
  80. dependencies : [thread_dep, glfw_dep, gl_dep, ws2_32_dep, winmm_dep, glu_dep, dl_dep, glu_dep],
  81. cpp_args: args)
  82. libgamingcore_dep = declare_dependency(
  83. include_directories : libgamingcore_include,
  84. link_with: libgamingcore)
  85. executable('tests',
  86. sources: src_tests,
  87. dependencies : libgamingcore_dep,
  88. cpp_args: args + ['-DLOG_LEVEL=4'])