You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guide/src/building_and_distribution.md
+7-9Lines changed: 7 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -84,17 +84,13 @@ Cross compiling PyO3 modules is relatively straightforward and requires a few pi
84
84
* The appropriate options in your Cargo `.config` for the platform you're targeting and the toolchain you are using.
85
85
* A Python interpreter that's already been compiled for your target.
86
86
* A Python interpreter that is built for your host and available through the `PATH` or setting the [`PYO3_PYTHON`](#python-version) variable.
87
-
* The headers that match the above interpreter.
88
87
89
-
See https://github.com/japaric/rust-cross for a primer on cross compiling Rust in general.
88
+
See [github.com/japaric/rust-cross](https://github.com/japaric/rust-cross) for a primer on cross compiling Rust in general.
90
89
91
90
After you've obtained the above, you can build a cross compiled PyO3 module by setting a few extra environment variables:
92
91
93
-
*`PYO3_CROSS_LIB_DIR`: This variable must be set to the directory containing the target's libpython DSO and the associated `_sysconfigdata*.py` file.
94
-
*`PYO3_CROSS_PYTHON_VERSION`: Major and minor version (e.g. 3.9) of the target Python installation. This variable is only needed if pyo3 cannot determine the version to target by other means:
95
-
- From `PYO3_CROSS_INCLUDE_DIR` or abi3-py3* features when targeting Windows, or
96
-
- if there are multiple versions of python present in `PYO3_CROSS_LIB_DIR` when targeting unix.
97
-
*`PYO3_CROSS_INCLUDE_DIR`: This variable can optionally be set to the directory containing the headers for the target's Python interpreter when targeting Windows.
92
+
*`PYO3_CROSS_LIB_DIR`: This variable must be set to the directory containing the target's libpython DSO and the associated `_sysconfigdata*.py` file for Unix-like targets, or the Python DLL import libraries for the Windows target.
93
+
*`PYO3_CROSS_PYTHON_VERSION`: Major and minor version (e.g. 3.9) of the target Python installation. This variable is only needed if PyO3 cannot determine the version to target from `abi3-py3*` features, or if there are multiple versions of Python present in `PYO3_CROSS_LIB_DIR`.
98
94
99
95
An example might look like the following (assuming your target's sysroot is at `/home/pyo3/cross/sysroot` and that your target is `armv7`):
0 commit comments