File: meson.build

package info (click to toggle)
meson-python 0.17.1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,120 kB
  • sloc: python: 2,788; ansic: 219; makefile: 8
file content (39 lines) | stat: -rw-r--r-- 917 bytes parent folder | download | duplicates (2)
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
# SPDX-FileCopyrightText: 2022 The meson-python developers
#
# SPDX-License-Identifier: MIT

project('executable-bit', 'c', version: '1.0.0')

fs = import('fs')
py = import('python').find_installation()

executable(
    'example',
    'example.c',
    install: true,
)

install_data(
    'example-script.py',
    rename: 'example-script',
    install_dir: get_option('bindir'),
)

py.install_sources('executable_module.py')

version_gen = files('generate_version.py')

if fs.exists('_version_meson.py')
    py.install_sources('_version_meson.py')
else
    custom_target(
        'write_version_file',
        output: '_version_meson.py',
        command: [py, version_gen, '-o', '@OUTPUT@'],
        build_by_default: true,
        build_always_stale: true,
        install: true,
        install_dir: py.get_install_dir(pure: false),
    )
    meson.add_dist_script(py, version_gen, '-o', '_version_meson.py')
endif