-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
30 lines (25 loc) · 891 Bytes
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
project('meson-cpp-pybind11', 'cpp', version : '1.0.0')
# python module
python_installation = import('python').find_installation('python3')
pybind11_includes = run_command(python_installation, '-c', 'import pybind11; print(pybind11.get_include());', check : true).stdout().strip()
# api
api_lib = static_library('api',
['api/api.h', 'api/api.cpp']
)
python_installation.extension_module('api',
sources : ['api/api-python.cpp'],
include_directories : pybind11_includes,
dependencies : python_installation.dependency(),
link_with : api_lib,
)
executable('cpp-client',
sources : ['main.cpp'],
include_directories : ['api'],
link_with : api_lib,
)
# examples
python_installation.extension_module('meson_example',
sources : ['examples/meson/main.cpp'],
include_directories : pybind11_includes,
dependencies : python_installation.dependency(),
)