120 lines
2.3 KiB
Meson
120 lines
2.3 KiB
Meson
project('fakir',
|
|
'cpp',
|
|
version: '0.0.0',
|
|
default_options: [
|
|
'warning_level=3',
|
|
'cpp_std=c++17',
|
|
'prefix=/usr',
|
|
])
|
|
|
|
extra_libs = get_option('prefix') / get_option('libdir') / 'fakir'
|
|
|
|
# CONFIGURATION
|
|
# =============
|
|
conf = configuration_data()
|
|
conf.set('version', meson.project_version())
|
|
conf.set('libs', extra_libs)
|
|
|
|
configure_file(input: 'src/conf.in.hpp',
|
|
output: 'conf.hpp',
|
|
configuration: conf)
|
|
|
|
# CORE LIB
|
|
# ========
|
|
fakir_cpp = [
|
|
'src/Node.cpp',
|
|
'src/Loc.cpp',
|
|
|
|
'src/Lexer.cpp',
|
|
'src/Parser.cpp',
|
|
'src/Constant.cpp',
|
|
'src/NativeFunction.cpp',
|
|
'src/Lambda.cpp',
|
|
'src/Array.cpp',
|
|
'src/NativeMacro.cpp',
|
|
'src/SymTable.cpp',
|
|
'src/SymEntry.cpp',
|
|
|
|
'src/Compiler.cpp',
|
|
'src/VM.cpp',
|
|
'src/Program.cpp',
|
|
'src/Module.cpp',
|
|
]
|
|
|
|
fakir_hpp = [
|
|
'src/Array.hpp',
|
|
'src/Node.hpp',
|
|
'src/Loc.hpp',
|
|
'src/Lexer.hpp',
|
|
'src/Parser.hpp',
|
|
'src/Constant.hpp',
|
|
'src/SymTable.hpp',
|
|
'src/SymEntry.hpp',
|
|
|
|
'src/Compiler.hpp',
|
|
'src/VM.hpp',
|
|
'src/Program.hpp',
|
|
'src/Module.hpp',
|
|
'src/NativeFunction.hpp',
|
|
'src/Lambda.hpp',
|
|
'src/NativeMacro.hpp',
|
|
'src/opcodes.hpp',
|
|
'src/commons.hpp',
|
|
'src/types.hpp',
|
|
]
|
|
|
|
pkg = import('pkgconfig')
|
|
|
|
fakir_lib = shared_library('fakir',
|
|
sources: fakir_cpp,
|
|
install: true)
|
|
|
|
pkg.generate(fakir_lib, subdirs: ['fakir'])
|
|
|
|
install_headers(fakir_hpp, subdir: 'fakir')
|
|
|
|
fakir_dep = declare_dependency(
|
|
link_with: fakir_lib
|
|
)
|
|
|
|
# STD LIB
|
|
# =======
|
|
|
|
shared_library('fakir-std',
|
|
sources: [
|
|
'libstd/lib.cpp',
|
|
'libstd/fun.cpp',
|
|
'libstd/macro.cpp',
|
|
],
|
|
dependencies: [
|
|
fakir_dep
|
|
],
|
|
install_dir: extra_libs,
|
|
install: true)
|
|
|
|
|
|
# COMPILER
|
|
# ========
|
|
executable('fakir',
|
|
sources: [
|
|
'src/main.cpp',
|
|
],
|
|
dependencies: [
|
|
fakir_dep
|
|
],
|
|
install: true)
|
|
|
|
# TESTS
|
|
# =====
|
|
executable('fakir-tests',
|
|
sources: [
|
|
'tests/main.cpp',
|
|
'tests/Lexer.cpp',
|
|
'tests/Parser.cpp',
|
|
'tests/SymTable.cpp',
|
|
],
|
|
dependencies: [
|
|
fakir_dep,
|
|
dependency('catch2')
|
|
])
|