File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -64,18 +64,28 @@ A shared library produced by ``library()`` or ``shared_library()`` built like th
64
64
65
65
is installed to ``libdir `` by default. If the only reason the shared library exists
66
66
is to be used inside the Python package being built, then it is best to modify
67
- the install location to be within the Python package itself:
67
+ the install location, via the ``install_dir `` argument, to be within
68
+ the Python package itself:
68
69
69
- .. code-block :: python
70
+ .. TODO update the text block below to 'meson' when
71
+ .. meson lexer is updated to fix
72
+ .. https://github.com/pygments/pygments/issues/2918
70
73
71
- install_path: py.get_install_dir() / ' mypkg/subdir'
74
+ .. code-block :: text
75
+
76
+ example_lib = shared_library(
77
+ 'example',
78
+ 'examplelib.c',
79
+ install: true,
80
+ install_dir: py.get_install_dir() / 'mypkg/subdir',
81
+ )
72
82
73
83
Then an extension module in the same install directory can link against the
74
84
shared library in a portable manner by using ``install_rpath ``:
75
85
76
86
.. code-block :: meson
77
87
78
- py3 .extension_module('_extmodule',
88
+ py .extension_module('_extmodule',
79
89
'_extmodule.c',
80
90
link_with: example_lib,
81
91
install: true,
You can’t perform that action at this time.
0 commit comments