Metadata-Version: 2.4
Name: build_system_parser
Version: 0.0.3
Summary: Control all Build Systems
Author-email: FloydZ <floyd@example.com>
Maintainer-email: FloydZ <floyd@example.com>
License: MIT
Project-URL: Homepage, https://github.com/FloydZ/build_system_parser
Project-URL: Repository, https://github.com/FloydZ/build_system_parser
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: pylint
Requires-Dist: pytest

Build System Parser:
==============

This library wraps common build systems and let you control
them via python. Supported build systems are
- `bazel`
- `make`
- `CMake`
- `ninja`
- `cargo`
- `compile_commands.json`

Installation:
===========

```shell
pip install build_system_parser
```

A `shell.nix` is provided for local development.

Usage:
======

You can either use the function `find_build_system(path)` to detect
the build system automatically like:
```python
# import this package
from build_system_parser import find_build_system

# parse the build system
B = find_build_system("path/to/Makefile")

# afterward the following functions are available
# get all available targets
all_targets = B.targets()
target = B.target("simple")

# build the target via
target.build()
# or
B.build(target)

# now you can run the target
target.run()
B.run(target)
```

Alternatively you can use a specific build system wrapper directly:
```python
# available builders: Ninja, Make, CMake, Compile_Commands, Cargo
from build_system_parser import Ninja
B = Ninja("path/to/build.ninja")
B.targets()
B.build(B.target("simple"))
```

Additionally, you can pass specific compiler flags to the builder:
```python
from build_system_parser import Make
B = Make("path/to/Makefile")
t = B.target("name_of_target")
B.build(t, "-O3 -march=native -fno-inline")
B.run(t)
```
