A modular, extensible build system.
This build system is designed with modularity, extensibility, and user experience in mind. Key features include:
- Modular architecture with clear separation of concerns
- JSON configuration support in addition to command-line arguments
- Build performance tracking for each dependency
- Dependency visualization to understand build relationships
- Environment management for better developer experience
- Improved logging with different verbosity levels
- Selective rebuilding of dependencies
- Self-diagnostic capabilities to identify issues before building
Build Club is built on the learning from mkvfx, the USD build system, tinyusd, and many others. It consolidates best practices and examples and primarily serves as a test bed for build concepts, and as a source of implementation for a number of tricky or error prone operations.
# Clone the repository
git clone https://github.com/vfxpro99/build_club.git
cd build_club# Build OpenEXR with default settings
python -m build_club /path/to/install --build-openexr
# Build with a configuration file
python -m build_club /path/to/install --config config.json
# Generate a dependency graph visualization
python -m build_club /path/to/install --build-openexr --gen-graph deps.html
# Perform a dry run to validate configuration
python -m build_club /path/to/install --build-openexr --dry-runThe build system can be configured either via command-line arguments or a JSON configuration file:
{
"install_dir": "/path/to/install",
"build_dir": "/path/to/build",
"src_dir": "/path/to/src",
"build_variant": "release",
"build_type": "shared",
"jobs": 8,
"dependencies": [
"openexr"
]
}build_club/
├── __init__.py # Package initialization
├── main.py # Main entry point
├── context.py # Build context class
├── logger.py # Logging system
├── dependency.py # Base dependency class
├── cmake_dependency.py # CMake dependency base class
├── dependency_graph.py # Dependency resolution
├── dependencies/ # Dependency implementations
│ ├── __init__.py
│ ├── openexr.py # OpenEXR dependency
│ └── ... # Other dependencies
└── platforms/ # Platform-specific code
├── __init__.py
├── apple.py # Apple platform support
├── linux.py # Linux platform support
└── windows.py # Windows platform support
To add a new dependency, create a new class in the dependencies directory:
from ..cmake_dependency import CMakeDependency
class MyDependency(CMakeDependency):
def __init__(self, version="1.0.0"):
url = f"https://example.com/mydep-{version}.zip"
super().__init__(
name="mydep",
version=version,
url=url,
display_name="My Dependency"
)
# Add validation files
self.add_validation_file("include/mydep/version.h")
# Set default CMake options
self.add_cmake_option("-DBUILD_TESTING=OFF")
# Set dependencies
self.add_dependency("openexr")Then, register the dependency in dependencies/__init__.py:
from .mydep import MyDependency
DEPENDENCY_CLASSES = {
'openexr': OpenEXRDependency,
'mydep': MyDependency,
# Add more dependencies as they are implemented
}The system can generate dependency graph visualizations in multiple formats:
- DOT: For use with Graphviz
- JSON: For custom processing
- HTML: Interactive browser-based visualization
Example:
python -m build_club /path/to/install --build-openexr --gen-graph deps.htmlTo contribute to the project:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Run tests:
pytest - Submit a pull request
This project is licensed under the terms of the LICENSE.txt file.