75 lines
1.2 KiB
Meson
75 lines
1.2 KiB
Meson
project(
|
|
'roza',
|
|
'c',
|
|
version: '0.0.0'
|
|
)
|
|
|
|
cc = meson.get_compiler('c')
|
|
m_dep = cc.find_library('m', required: true)
|
|
|
|
conf = configuration_data()
|
|
conf.set('version', meson.project_version())
|
|
|
|
configure_file(
|
|
input: 'lib/conf.in.h',
|
|
output: 'conf.h',
|
|
configuration: conf
|
|
)
|
|
|
|
roza_lib = static_library(
|
|
'roza',
|
|
sources: [
|
|
# utils
|
|
'lib/str.c',
|
|
|
|
# core
|
|
'lib/err.c',
|
|
'lib/loader.c',
|
|
|
|
# lang
|
|
'lib/node.c',
|
|
'lib/lexer.c',
|
|
'lib/parser.c',
|
|
'lib/type.c',
|
|
'lib/value.c',
|
|
'lib/tysy.c',
|
|
|
|
# comp
|
|
'lib/opcodes.c',
|
|
'lib/mod.c',
|
|
'lib/prepass.c',
|
|
'lib/compiler.c',
|
|
|
|
# exec
|
|
'lib/vm.c',
|
|
],
|
|
|
|
dependencies: [
|
|
m_dep
|
|
]
|
|
)
|
|
|
|
roza_dep = declare_dependency(
|
|
link_with: roza_lib,
|
|
include_directories: ['lib']
|
|
)
|
|
|
|
executable('roza',
|
|
sources: [
|
|
'src/main.c'
|
|
],
|
|
dependencies: [
|
|
roza_dep
|
|
],
|
|
install: true)
|
|
|
|
executable('roza-tests',
|
|
sources: [
|
|
'tests/units/lexer.c',
|
|
'tests/units/parser.c',
|
|
],
|
|
dependencies: [
|
|
roza_dep,
|
|
dependency('criterion')
|
|
])
|