File: meson.build

package info (click to toggle)
meson-python 0.19.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,328 kB
  • sloc: python: 3,114; ansic: 304; cpp: 16; makefile: 8
file content (41 lines) | stat: -rw-r--r-- 888 bytes parent folder | download
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
# SPDX-FileCopyrightText: 2022 The meson-python developers
#
# SPDX-License-Identifier: MIT

if meson.get_compiler('c').get_id() in ['msvc', 'clang-cl', 'intel-cl']
    export_dll_args = ['-DMYPKG_DLL_EXPORTS']
    import_dll_args = ['-DMYPKG_DLL_IMPORTS']
else
    export_dll_args = []
    import_dll_args = []
endif

example_lib = shared_library(
    'examplelib',
    'examplelib.c',
    c_args: export_dll_args,
    install: true,
    install_dir: py.get_install_dir() / 'mypkg',
)

example_lib_dep = declare_dependency(
    compile_args: import_dll_args,
    link_with: example_lib,
)

subdir('sub')

py.extension_module(
    '_example',
    '_examplemod.c',
    dependencies: [example_lib_dep, example_lib2_dep],
    include_directories: 'sub',
    install: true,
    subdir: 'mypkg',
    install_rpath: '$ORIGIN',
)

py.install_sources(
    ['__init__.py'],
    subdir: 'mypkg',
)