1# python-build: automated build system generation 2 3Goal: ease the integration of Mesa as a component inside larger projects like 4Android (AOSP). 5 6How: parse the meson build tree into a python build script, which can be used 7together with configuration and options to generate other kinds of build scripts. 8 9Status: useful inside AOSP but very rough, still work in progress really. 10Android is the only supported target build system, but this work can hopefully 11also support Bazel. Many meson features are unimplemented and some are probably 12poorly implemented. Python code needs a thorough cleanup. 13 14## 1 - Generate python from meson 15 16generate_python_build.py: reads meson.build files (following subdir() commands) 17and uses meson2python to transform the meson into python. 18 19meson2python.py: passes meson.build input and the meson grammar to python lark 20(https://github.com/lark-parser/lark) to perform lexing and parsing; then 21transforms the parse tree into valid python. The result is one large python script. 22 23## 2 - Generate Android.bp from python 24 25meson_android.py defines the meson API entry points and emits Android.bp build 26constructs. A config file is read to determine some build parameters such as 27`cpu_family` (similar to meson's cross file). 28 29## Limitations 30 31Meson build options must be set by modifying the defaults in meson_options.txt. 32