project('core', 'cpp', default_options : ['cpp_std=c++2a']) src = [ 'utils/Logger.cpp', 'utils/Utility.cpp', 'data/BitArray.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', ] 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' ]) 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 + ['-DLOG_LEVEL=4'], link_args: link_args)