-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmeson.build
More file actions
31 lines (30 loc) · 1.42 KB
/
Copy pathmeson.build
File metadata and controls
31 lines (30 loc) · 1.42 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
project('gmp', 'c',
version: run_command('python', 'scripts/gitversion.py',
check: true).stdout().strip(),
default_options: ['c_std=c17'])
cc = meson.get_compiler('c')
py = import('python').find_installation(pure: false)
freethreaded = py.get_variable('Py_GIL_DISABLED', 0) == 1
if freethreaded and cc.get_id() == 'msvc'
add_project_arguments('/experimental:c11atomics', language: 'c')
endif
libzz = dependency('zz', version: '>= 0.9.0a4')
py.extension_module('gmp', ['fmt.c', 'extra.c', 'gmp.c', 'utils.c'],
install: true, dependencies: libzz)
install_dir = py.get_install_dir()
# Generate version.py for sdist
meson.add_dist_script(['scripts/gitversion.py', '--meson-dist',
'--write', '_version.py'])
fs = import('fs')
if not fs.exists('_version.py')
generate_version = custom_target('generate-version',
install: true,
build_always_stale: true,
build_by_default: true,
output: '_version.py',
input: 'scripts/gitversion.py',
command: [py, '@INPUT@', '--write',
'@OUTPUT@'],
install_dir: install_dir,
install_tag: 'python-runtime')
endif