A build system for C++.
Project description
Buildcpp: A Python Build System for C++ Projects
Buildcpp is a build tool that uses Python as the scripting language for C++ projects. Its minimalist design makes building C++ projects straightforward and efficient.
Installation
Buildcpp requires Python 3.7 or higher. You can download Python from python.org.
Once Python is installed, install Buildcpp via pip:
pip install buildcpp
Buildcpp also depends on CMake 3.15 or later, which you can download from cmake.org.
Under the hood, Buildcpp uses Python for front-end scripting and CMake as the back-end build engine.
Usage
Buildcpp is a Python package that provides a set of APIs for defining and building C++ projects.
To use it, simply create a Python script in your project directory and define your build using Buildcpp’s API. Running this script will execute the build.
While Buildcpp uses a script-based approach, the script itself resembles a configuration file. This design choice stems from the fact that C++ builds often involve numerous configuration options, which can become cumbersome in static configuration files.
Here’s a minimal example:
from buildcpp import Target, Builder, Scope
from pathlib import Path
# Get current directory
ROOT = Path(__file__).parent
# Define a build target
target = Target('main')\
.add_sources(Scope.PRIVATE, ROOT / 'main.cpp')
if __name__ == '__main__':
# Create a builder and compile the target
builder = Builder()
builder.attach(target)
builder.build()
Even without prior Python experience, you can likely understand what’s happening if you’re familiar with C++.
The Target object is central to Buildcpp—it holds all the metadata needed for the build, much like a configuration file.
If you want to learn more, check out the documentation.
LICENSE
This project is licensed under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file buildcpp-0.2.4.tar.gz.
File metadata
- Download URL: buildcpp-0.2.4.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f633cd54ba47f414037a0a9757ec638b68b29cff4b5d81cf85de85f9b213de8c
|
|
| MD5 |
cd52df8deac6aa097a1c8e80df21bdd4
|
|
| BLAKE2b-256 |
058a1e5a442c6ec156ddac57a960560c58017c580f48282ee11852d25d835e95
|
File details
Details for the file buildcpp-0.2.4-py3-none-any.whl.
File metadata
- Download URL: buildcpp-0.2.4-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee308efabd30ed2e215d8ecfd845dce201baa62799db71cc5b2fb0150f40b7ed
|
|
| MD5 |
cb43c81fb0db8c109b2fadf8d2c8c41d
|
|
| BLAKE2b-256 |
2d7ccdf6058a9feb9b92f5768b687126386da7a87bd53b9c2d0029e65efc7576
|