ADD: install project headers and generate pkg-config pc file.

main
bog 2023-09-14 12:32:17 +02:00
parent 43a8c0c113
commit 47b44d3439
1 changed files with 33 additions and 3 deletions

View File

@ -3,7 +3,8 @@ project('grino',
version: '0.0.0',
default_options: [
'warning_level=3',
'cpp_std=c++17'
'cpp_std=c++17',
'prefix=/usr'
])
grino_libdir = get_option('prefix') / get_option('libdir') / 'grino'
@ -16,7 +17,8 @@ configure_file(input: 'src/config.in.hpp',
output: 'config.hpp',
configuration: conf)
grino_src = static_library('grino',
grino_src = shared_library('grino',
sources: [
'src/Compiler.cpp',
'src/Lexer.cpp',
@ -33,7 +35,35 @@ grino_src = static_library('grino',
'src/Loader.cpp',
'src/Addr.cpp',
'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'
)
grino_dep = declare_dependency(link_with: grino_src)