-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmeson.build
More file actions
77 lines (67 loc) · 1.48 KB
/
meson.build
File metadata and controls
77 lines (67 loc) · 1.48 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
project(
'npyodbc',
'cpp',
version: run_command(['python', '-m', 'setuptools_scm'], check: true).stdout().strip(),
default_options: ['cpp_std=c++17']
)
python = import('python').find_installation(pure: false)
python_dep = python.dependency()
# ODBC driver needs to be installed by the OS.
compiler = meson.get_compiler('cpp')
numpy_inc = include_directories(
run_command(
python,
['-c', 'import numpy; print(numpy.get_include())'],
check : true,
).stdout().strip()
)
numpy_dep = declare_dependency(include_directories: numpy_inc)
# Patch pyodbc and declare it (and odbc itself) as dependencies
subproject('pyodbc')
pyodbc_dep = dependency('pyodbc')
odbc_dep = dependency('odbc')
icu_dep = dependency('icu-uc')
npyodbc_inc = include_directories('include')
npyodbc_sources = [
'src/npcontainer.cpp',
'src/npyodbcmodule.cpp'
]
python.install_sources(
[
'npyodbc/__init__.py',
],
subdir: 'npyodbc',
)
add_project_arguments(
[
'-DPYODBC_VERSION=' + meson.project_version(),
],
language: 'cpp'
)
deps = []
cflags = []
lflags = []
python.install_sources(
[
'npyodbc/__init__.py',
'npyodbc/__init__.pyi',
'npyodbc/_npyodbc.pyi',
],
subdir: 'npyodbc',
)
# Build the npyodbc module
python.extension_module(
'_npyodbc',
npyodbc_sources,
dependencies : [
python_dep,
numpy_dep,
pyodbc_dep,
icu_dep,
] + deps,
include_directories : [npyodbc_inc],
install : true,
cpp_args : cflags,
link_args : lflags,
subdir: 'npyodbc',
)