Skip to content

Commit 24b6596

Browse files
committed
[Docs] mention Pyodide-specific config options, cross.soabi
1 parent 50ce8a1 commit 24b6596

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

docs/reference/config.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ Specific options for macOS.
105105
| `cmake` | macOS-specific CMake options.<br/>Inherits from: `/pyproject.toml/tool/py-build-cmake/cmake` | | `none` |
106106
| `wheel` | macOS-specific Wheel options.<br/>Inherits from: `/pyproject.toml/tool/py-build-cmake/wheel` | | `none` |
107107

108+
## pyodide
109+
Specific options for Pyodide.
110+
111+
| Option | Description | Type | Default |
112+
|--------|-------------|------|---------|
113+
| `editable` | Pyodide-specific editable options.<br/>Inherits from: `/pyproject.toml/tool/py-build-cmake/editable` | | `none` |
114+
| `sdist` | Pyodide-specific sdist options.<br/>Inherits from: `/pyproject.toml/tool/py-build-cmake/sdist` | | `none` |
115+
| `cmake` | Pyodide-specific CMake options.<br/>Inherits from: `/pyproject.toml/tool/py-build-cmake/cmake` | | `none` |
116+
| `wheel` | Pyodide-specific Wheel options.<br/>Inherits from: `/pyproject.toml/tool/py-build-cmake/wheel` | | `none` |
117+
108118
## cross
109119
Causes py-build-cmake to cross-compile the project. See <project:../usage/cross-compilation.md> for more information.
110120

@@ -115,9 +125,10 @@ Causes py-build-cmake to cross-compile the project. See <project:../usage/cross-
115125
| `version` | Python version, major and minor, without dots.<br/>For details about platform compatibility tags, see the PyPA specification: <https://packaging.python.org/en/latest/specifications/platform-compatibility-tags><br/>For example: `version = '310' # 3.10` | string | `same as current interpreter` |
116126
| `abi` | Python ABI.<br/>For details about platform compatibility tags, see the PyPA specification: <https://packaging.python.org/en/latest/specifications/platform-compatibility-tags><br/>For example: `abi = 'cp310'` | string | `same as current interpreter` |
117127
| `arch` | Platform tag, consisting of the operating system and architecture (no dots or dashes, only underscores, all lowercase).<br/>For details about platform compatibility tags, see the PyPA specification: <https://packaging.python.org/en/latest/specifications/platform-compatibility-tags><br/>For example: `arch = 'linux_x86_64'` | string | `same as current interpreter` |
118-
| `prefix` | Root path of the Python installation. Used to set the `Python3_ROOT_DIR` CMake hint, see <https://cmake.org/cmake/help/latest/module/FindPython3.html#hints>.<br/>Absolute or relative to current configuration file. | path | `none` |
128+
| `prefix` | Root path of the Python installation. Used to set the `Python3_ROOT_DIR` and `Python3_ROOT` CMake hints, see <https://cmake.org/cmake/help/latest/module/FindPython3.html#hints>.<br/>Absolute or relative to current configuration file. | path | `none` |
119129
| `library` | Python library file (.so on Linux, .lib on Windows). Used to set the `Python3_LIBRARY` CMake artifact, see <https://cmake.org/cmake/help/latest/module/FindPython3.html#artifacts-specification>.<br/>Absolute or relative to current configuration file. | filepath | `none` |
120130
| `include_dir` | Python include directory (containing Python.h). Used to set the `Python3_INCLUDE_DIR` CMake artifact, see <https://cmake.org/cmake/help/latest/module/FindPython3.html#artifacts-specification>.<br/>Absolute or relative to current configuration file. | path | `none` |
131+
| `soabi` | Used to set the `Python3_SOABI` CMake variable, see <https://cmake.org/cmake/help/latest/module/FindPython3.html#artifacts-specification>.<br/>For example: `soabi = 'cpython-310-x86_64-linux-gnu'` | string | `none` |
121132
| `toolchain_file` | CMake toolchain file to use. See <https://cmake.org/cmake/help/book/mastering-cmake/chapter/Cross%20Compiling%20With%20CMake.html> for more information.<br/>Absolute or relative to current configuration file. | filepath | `none` |
122133
| `generator_platform` | The value for `CMAKE_GENERATOR_PLATFORM`. Only applies to the Visual Studio generator on Windows. See <https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_PLATFORM.html> for details.<br/>For example: `generator_platform = 'ARM64'` | string | `none` |
123134
| `editable` | Override editable options when cross-compiling.<br/>Inherits from: `/pyproject.toml/tool/py-build-cmake/editable` | | `none` |

docs/usage/cross-compilation.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ When using py-build-cmake, cross-compiling Python extension modules is supported
99
out-of-the-box through [CMake toolchain files](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html).
1010
When building packages using a tool like [`cibuildwheel`](https://github.com/pypa/cibuildwheel),
1111
cross-compilation will also be enabled automatically whenever appropriate
12-
(e.g. when building ARM64 packages on an Intel Mac).
12+
(e.g. when building ARM64 packages on an Intel Mac, or when building for Pyodide).
1313

1414
## Terminology
1515

@@ -450,6 +450,9 @@ cibuildwheel --platform pyodide
450450

451451
Details can be found in `src/py_build_cmake/config/quirks/pyodide.py`.
452452

453+
Pyodide-specific options can be added in the `[tool.py-build-cmake.pyodide]`
454+
section of `pyproject.toml`.
455+
453456
```{note}
454457
Current releases of `pyodide-build` have a bug that causes py-build-cmake to be
455458
ignored when installing build dependencies, because its name contains `cmake`:

src/py_build_cmake/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def format(md, component):
248248
"build_component backend:"
249249
)
250250
pr_md(
251-
"# py-build-cmake component build backend\n"
251+
"# Component build backend configuration options\n\n"
252252
"The `py_build_cmake.build_component` build backend allows "
253253
"building packages containing additional binaries that are not "
254254
"included with the main distribution.\n"

0 commit comments

Comments
 (0)