project('core', 'cpp', default_options : ['cpp_std=c++2a']) src = [ 'utils/Logger.cpp', 'utils/Utility.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/ProbingHashMapTests.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', ] src_performance = [ 'performance/Main.cpp', 'test/Test.cpp', ] compiler = meson.get_compiler('cpp') error_args = compiler.get_supported_arguments([ '-Wdeprecated-enum-float-conversion', '-Wctad-maybe-unsupported', '-Werror', '-Wdeprecated-enum-enum-conversion', '-Winvalid-imported-macros', '-Wextra', '-Wzero-as-null-pointer-constant', '-Wframe-larger-than=8388608', '-Wundef', '-Wunused-const-variable=2', '-Wconditionally-supported', '-Wwrite-strings', '-Wlarger-than=1073741824', '-Wimplicit-fallthrough=5', '-Wduplicated-cond', '-Wdisabled-optimization', '-Wsuggest-final-methods', '-Wformat-signedness', '-Wtrivial-auto-var-init', '-Wmissing-include-dirs', '-Winfinite-recursion', '-Wdeprecated-copy-dtor', '-Wanalyzer-too-complex', '-Wduplicated-branches', '-Wstrict-null-sentinel', '-Wmissing-declarations', '-Wformat-truncation=2', '-Wmultiple-inheritance', '-Wstack-usage=8388608', '-Winit-self', '-Wsynth', '-Wvirtual-inheritance', '-Wstringop-overflow=4', '-Wcast-qual', '-Wshadow', '-Wsuggest-final-types', '-Woverloaded-virtual', '-Wconversion', '-Walloca', '-Woverlength-strings', '-Wctor-dtor-privacy', '-Wswitch-enum', '-pedantic', '-Wstrict-overflow=2', '-Wcast-align=strict', '-Wfloat-equal', '-Wformat=2', '-Wattribute-alias=2', '-Wformat-overflow=2', '-Winvalid-pch', '-Wvolatile', '-Wshift-overflow=2', '-Warith-conversion', '-Wcatch-value=3', '-Wnoexcept', '-Wuse-after-free=3', '-Wdouble-promotion', '-Wunused-macros', '-Wregister', '-Wsuggest-override', '-Wnull-dereference', '-Wtrampolines', '-Wlogical-op', '-Wnon-virtual-dtor', '-pedantic-errors', '-Wbidi-chars=any', '-Wdate-time', '-Warray-parameter', '-Waligned-new=all', '-Wold-style-cast', '-Wmultichar', '-Wstack-protector', '-Wmissing-braces', '-Warray-bounds=2', '-Walloc-zero', '-Wplacement-new=2', '-Wmismatched-tags', '-Wcomma-subscript', '-Wall', '-Wbidi-chars', '-Wredundant-tags', '-Wenum-conversion', '-Wall', '-Wredundant-decls', '-Wsign-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 + ['-DCORE_LOG_LEVEL=4'], 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) executable('performance', sources: src_performance, dependencies: core_dep, cpp_args: error_args + compile_args + ['-DCORE_LOG_LEVEL=4'], link_args: link_args)