xbuild is PEP 517 build frontend that has additions and extensions to support cross-compiling wheels for platforms where compilation cannot be performed natively - most notably:
- Android
- Emscripten (WASM)
- iOS
Create a virtual environment for your build platform (i.e., the platform where you will be compiling), and install xbuild. Then, run xbuild from the root directory of the project you want to build. You must pass in the --sysconfig argument, providing the path to the sysconfig_vars JSON file for the target platform, or the equivalent sysconfigdata python configuration:
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ python -m pip install xbuild
(venv) $ python -m xbuild --sysconfig path/to/_sysconfig_vars__...jsonThis will do the equivalent of python -m build, but in an cross-platform environment that is pretending to be the environment described by the sysconfig data that has been provided.
To explicitly create a cross-platform virtual environment, start by creating a virtual environment for your build platform (i.e., the platform where you will be compiling), then install and use the xvenv script to create cross-platform virtual environment.
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ python -m pip install xbuild
(venv) $ python -m xvenv --sysconfig path/to/_sysconfig_vars__...json x-venvYou can then activate and deactivate the x-venv environment as you would any other virtual environment.
Documentation for Toga Chart can be found on Read The Docs.
xbuild is part of the BeeWare suite. You can talk to the community through:
We foster a welcoming and respectful community as described in our BeeWare Community Code of Conduct.
If you experience problems with xbuild, log them on GitHub. If you want to contribute code, please fork the code and submit a pull request.