grino/meson.build

109 lines
2.8 KiB
Meson
Raw Normal View History

2023-09-10 23:05:29 +00:00
project('grino',
'cpp',
version: '0.0.0',
default_options: [
'warning_level=3',
'cpp_std=c++17',
'prefix=/usr'
2023-09-10 23:05:29 +00:00
])
2023-09-11 10:14:01 +00:00
grino_libdir = get_option('prefix') / get_option('libdir') / 'grino'
2023-09-10 23:05:29 +00:00
conf = configuration_data()
conf.set('version', meson.project_version())
2023-09-11 10:14:01 +00:00
conf.set('libdir', grino_libdir)
2023-09-10 23:05:29 +00:00
configure_file(input: 'src/config.in.hpp',
output: 'config.hpp',
configuration: conf)
grino_src = shared_library('grino',
2023-09-10 23:05:29 +00:00
sources: [
'src/Compiler.cpp',
'src/Lexer.cpp',
'src/Loc.cpp',
'src/Logger.cpp',
'src/Node.cpp',
'src/Parser.cpp',
'src/Program.cpp',
'src/VM.cpp',
'src/Value.cpp',
2023-09-11 10:14:01 +00:00
'src/Function.cpp',
'src/StaticFunction.cpp',
2023-09-11 06:00:50 +00:00
'src/SymTable.cpp',
2023-09-11 10:14:01 +00:00
'src/Loader.cpp',
2023-09-12 15:37:52 +00:00
'src/Addr.cpp',
2023-09-13 19:11:36 +00:00
'src/Module.cpp',
],
install: true)
pkg = import('pkgconfig')
pkg.generate(grino_src, subdirs: 'grino')
install_headers(
[
'build/config.hpp',
'src/commons.hpp',
'src/mutils.hpp',
'src/opcodes.hpp',
'src/types.hpp',
'src/Compiler.hpp',
'src/Lexer.hpp',
'src/Loc.hpp',
'src/Logger.hpp',
'src/Node.hpp',
'src/Parser.hpp',
'src/Program.hpp',
'src/VM.hpp',
'src/Value.hpp',
'src/Function.hpp',
'src/StaticFunction.hpp',
'src/SymTable.hpp',
'src/Loader.hpp',
'src/Addr.hpp',
'src/Module.hpp',
], subdir: 'grino'
)
2023-09-10 23:05:29 +00:00
grino_dep = declare_dependency(link_with: grino_src)
2023-09-11 10:14:01 +00:00
shared_library('grino_core',
sources: [
'lib/core.cpp'
],
dependencies: [
grino_dep
],
install: true,
install_dir: grino_libdir)
2023-09-14 12:34:51 +00:00
shared_library('grino_std',
sources: [
'lib/std/std.cpp'
],
dependencies: [
grino_dep
],
install: true,
install_dir: grino_libdir)
2023-09-10 23:05:29 +00:00
executable('grino',
sources: [
'src/main.cpp'
],
dependencies: [
grino_dep
],
install: true)
executable('grino-tests',
sources: [
'tests/main.cpp',
'tests/Lexer.cpp',
'tests/Parser.cpp',
],
dependencies: [
grino_dep,
dependency('catch2')
])