2023-09-17 17:26:22 +00:00
|
|
|
project('zarn',
|
|
|
|
'cpp',
|
|
|
|
version: '0.0.0',
|
|
|
|
default_options: [
|
|
|
|
'prefix=/usr',
|
|
|
|
'warning_level=3',
|
|
|
|
'cpp_std=c++17'
|
|
|
|
])
|
|
|
|
|
2023-09-18 15:33:04 +00:00
|
|
|
# CONFIGURATIONS
|
|
|
|
# ==============
|
2023-09-17 17:26:22 +00:00
|
|
|
extra_libdir = get_option('prefix') / get_option('libdir') / 'zarn'
|
|
|
|
|
2023-09-18 15:33:04 +00:00
|
|
|
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
|
|
|
|
# ========
|
2023-09-17 17:26:22 +00:00
|
|
|
zarn_lib = shared_library('zarn',
|
|
|
|
sources: [
|
|
|
|
'src/Module.cpp',
|
|
|
|
'src/Loc.cpp',
|
|
|
|
'src/Node.cpp',
|
|
|
|
'src/Logger.cpp',
|
|
|
|
'src/Lexer.cpp',
|
2023-09-17 19:36:58 +00:00
|
|
|
'src/Parser.cpp',
|
2023-09-18 15:33:04 +00:00
|
|
|
'src/StaticPass.cpp',
|
2023-09-17 19:36:58 +00:00
|
|
|
'src/Compiler.cpp',
|
|
|
|
'src/Program.cpp',
|
|
|
|
'src/VM.cpp',
|
|
|
|
'src/Constant.cpp',
|
2023-09-18 15:33:04 +00:00
|
|
|
'src/SymTable.cpp',
|
|
|
|
'src/NativeFunction.cpp',
|
|
|
|
'src/Prototype.cpp',
|
2023-09-18 17:08:32 +00:00
|
|
|
'src/NativeMacro.cpp',
|
2023-09-18 15:33:04 +00:00
|
|
|
'src/Zarn.cpp',
|
2023-09-17 17:26:22 +00:00
|
|
|
],
|
|
|
|
install: true)
|
|
|
|
|
|
|
|
zarn_dep = declare_dependency(link_with: zarn_lib)
|
|
|
|
|
2023-09-18 15:33:04 +00:00
|
|
|
# STANDARD LIBRARY
|
|
|
|
# ================
|
|
|
|
shared_library('zarn-std',
|
|
|
|
sources: [
|
|
|
|
'libstd/std.cpp',
|
|
|
|
'libstd/fun.cpp',
|
2023-09-18 17:08:32 +00:00
|
|
|
'libstd/macro.cpp',
|
2023-09-18 15:33:04 +00:00
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
zarn_dep
|
|
|
|
],
|
|
|
|
install_dir: extra_libdir,
|
|
|
|
install: true)
|
|
|
|
|
|
|
|
# COMPILER
|
|
|
|
# ========
|
2023-09-17 17:26:22 +00:00
|
|
|
executable('zarn',
|
|
|
|
sources: [
|
|
|
|
'src/main.cpp'
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
zarn_dep
|
|
|
|
],
|
|
|
|
install: true)
|
|
|
|
|
2023-09-18 15:33:04 +00:00
|
|
|
# TESTS
|
|
|
|
# =====
|
2023-09-17 17:26:22 +00:00
|
|
|
executable('zarn-tests',
|
|
|
|
sources: [
|
|
|
|
'tests/main.cpp',
|
|
|
|
'tests/Lexer.cpp',
|
|
|
|
'tests/Parser.cpp',
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
zarn_dep,
|
|
|
|
dependency('catch2')
|
|
|
|
])
|