Skip to content

Commit 07570cd

Browse files
committed
Add details for ldflags
1 parent 4e8a914 commit 07570cd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/details.md

+14
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,17 @@ import sys
4545

4646
sys.executable
4747
```
48+
49+
## `ldflags`
50+
51+
The recommended linker options for embedding the Python interpreter into another application, mostly extracted from the outputs of
52+
53+
`pythonX.Y-config --ldflags` for python `3.7` and
54+
55+
`pythonX.Y-config --ldflags --embed` for python `3.8+`,
56+
57+
with added library paths from `nativeLibraryPaths`
58+
59+
https://docs.python.org/3/extending/embedding.html#compiling-and-linking-under-unix-like-systems
60+
61+
The full path to `pythonX.Y-config` is `f"{sys.base_prefix}/bin/python{ldversion}-config"`.

0 commit comments

Comments
 (0)