project('zarn', 'cpp', version: '0.0.0', default_options: [ 'prefix=/usr', 'warning_level=3', 'cpp_std=c++17' ]) # CONFIGURATIONS # ============== extra_libdir = get_option('prefix') / get_option('libdir') / 'zarn' conf = configuration_data() conf.set('version', meson.project_version()) conf.set('libdir', extra_libdir) configure_file(input: 'src/config.in.hpp', output: 'config.hpp', configuration: conf) # ZARN_LIB # ======== zarn_lib = shared_library('zarn', sources: [ 'src/Module.cpp', 'src/Loc.cpp', 'src/Node.cpp', 'src/Logger.cpp', 'src/Lexer.cpp', 'src/Parser.cpp', 'src/StaticPass.cpp', 'src/Compiler.cpp', 'src/Program.cpp', 'src/VM.cpp', 'src/Constant.cpp', 'src/SymTable.cpp', 'src/NativeFunction.cpp', 'src/Prototype.cpp', 'src/Zarn.cpp', ], install: true) zarn_dep = declare_dependency(link_with: zarn_lib) # STANDARD LIBRARY # ================ shared_library('zarn-std', sources: [ 'libstd/std.cpp', 'libstd/fun.cpp', ], dependencies: [ zarn_dep ], install_dir: extra_libdir, install: true) # COMPILER # ======== executable('zarn', sources: [ 'src/main.cpp' ], dependencies: [ zarn_dep ], install: true) # TESTS # ===== executable('zarn-tests', sources: [ 'tests/main.cpp', 'tests/Lexer.cpp', 'tests/Parser.cpp', ], dependencies: [ zarn_dep, dependency('catch2') ])