123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- project('core', 'cpp', default_options : ['cpp_std=c++2a'])
- src = [
- 'utils/Logger.cpp',
- 'utils/Utility.cpp',
- 'utils/HashCode.cpp',
- 'utils/Buffer.cpp',
- 'utils/Clock.cpp',
- 'utils/Random.cpp',
- 'data/BitArray.cpp',
- 'math/Math.cpp',
- 'math/Vector.cpp',
- 'math/Quaternion.cpp',
- 'math/Matrix.cpp',
- 'math/Box.cpp',
- 'math/Plane.cpp',
- 'math/Frustum.cpp',
- 'math/View.cpp',
- 'thread/Thread.cpp',
- 'io/File.cpp',
- ]
- src_tests = [
- 'test/Main.cpp',
- 'test/Test.cpp',
- 'tests/ArrayTests.cpp',
- 'tests/ArrayStringTests.cpp',
- 'tests/UtilityTests.cpp',
- 'tests/ArrayListTests.cpp',
- 'tests/BitArrayTests.cpp',
- 'tests/MathTests.cpp',
- 'tests/ListTests.cpp',
- 'tests/LinkedListTests.cpp',
- 'tests/UniquePointerTests.cpp',
- 'tests/HashMapTests.cpp',
- 'tests/StackTests.cpp',
- 'tests/RingBufferTests.cpp',
- 'tests/ComponentsTests.cpp',
- 'tests/VectorTests.cpp',
- 'tests/QuaternionTests.cpp',
- 'tests/MatrixTests.cpp',
- 'tests/BoxTests.cpp',
- 'tests/BufferedValueTests.cpp',
- 'tests/PlaneTests.cpp',
- 'tests/FrustumTests.cpp',
- 'tests/ViewTests.cpp',
- 'tests/MatrixStackTests.cpp',
- 'tests/ColorTests.cpp',
- 'tests/BufferTests.cpp',
- 'tests/ClockTests.cpp',
- 'tests/RandomTests.cpp',
- 'tests/ThreadTests.cpp',
- 'tests/FileTests.cpp',
- ]
- compiler = meson.get_compiler('cpp')
- error_args = compiler.get_supported_arguments([
- '-Wcast-align=strict', '-pedantic', '-Wmissing-declarations', '-Wdate-time',
- '-Winit-self', '-Woverlength-strings', '-Wsign-promo', '-Wnon-virtual-dtor',
- '-Wconversion', '-Woverloaded-virtual', '-Wdeprecated-enum-enum-conversion',
- '-Wdisabled-optimization', '-Winvalid-imported-macros', '-Wduplicated-cond',
- '-Wdeprecated-enum-float-conversion', '-Wduplicated-branches', '-Wformat=2',
- '-Wmissing-braces', '-Wsuggest-override', '-Wcast-qual', '-Wbidi-chars=any',
- '-Wzero-as-null-pointer-constant', '-pedantic-errors', '-Wnull-dereference',
- '-Wformat-signedness', '-Wfloat-equal', '-Wvolatile', '-Wctor-dtor-privacy',
- '-Winfinite-recursion', '-Wshift-overflow=2', '-Wmultichar', '-Walloc-zero',
- '-Wcomma-subscript', '-Wold-style-cast', '-Wwrite-strings', '-Wswitch-enum',
- '-Wredundant-decls', '-Werror', '-Wsign-conversion', '-Walloca', '-Wshadow',
- '-Winvalid-pch', '-Wdeprecated-copy-dtor', '-Wundef', '-Wdouble-promotion',
- '-Warith-conversion', '-Wextra', '-Wtrivial-auto-var-init', '-Wlogical-op',
- '-Wall', '-Wenum-conversion'
- ])
- compile_args = compiler.get_supported_arguments([
- '-nostdinc++', '-fno-exceptions', '-fno-rtti', '-fno-threadsafe-statics'
- ])
- link_args = compiler.get_supported_arguments([
- '-nodefaultlibs', '-lc', '-lm', '-lpthread'
- ])
- core_include = [include_directories('.')]
- core = static_library('core',
- sources: src,
- include_directories: core_include,
- cpp_args: error_args + compile_args,
- link_args: link_args)
- core_dep = declare_dependency(
- include_directories: core_include,
- link_with: core)
- executable('tests',
- sources: src_tests,
- dependencies: core_dep,
- cpp_args: error_args + compile_args + ['-DCORE_LOG_LEVEL=4'],
- link_args: link_args)
|