Skip to content

Commit 31c07b8

Browse files
committed
TST: extend local lib test to verify Windows support
1 parent e3d475f commit 31c07b8

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import os
2+
3+
_path = os.path.join(os.path.dirname(__file__), '..', '.example.meson-libs')
4+
if os.name == 'nt':
5+
os.add_dll_directory(_path)
6+
elif sys.platform == 'cygwin':
7+
os.environ['PATH'] = os.pathsep.join((os.environ['PATH'], _path))
8+
del _path
9+
10+
from _example import *

tests/packages/link-against-local-lib/meson.build

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ subdir('lib')
88

99
py = import('python').find_installation()
1010

11+
py.install_sources(
12+
'__init__.py',
13+
subdir_name: 'example',
14+
)
15+
1116
py.extension_module(
12-
'example',
17+
'_example',
1318
'examplemod.c',
1419
link_with: example_lib,
1520
link_args: ['-Wl,-rpath,custom-rpath'],
1621
install: true,
22+
subdir_name: 'example',
1723
)

tests/packages/link-against-local-lib/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
[build-system]
66
build-backend = 'mesonpy'
77
requires = ['meson-python']
8+
9+
[tool.meson-python]
10+
allow-windows-shared-libs = true

0 commit comments

Comments
 (0)