r/cprogramming • u/Slight_Watch697 • Jun 02 '26
A better build system for C: bbs
Hi, I recently started working on a better build system for my C/C++ projects:
https://github.com/luppichristian/bbs.
It's basically a build system "frontend" built on top of cmake and bash that allows you to:
- Metabuilder support (modify the compilation at runtime WITH CUSTOM HOOKED DLLS)
- Automatic SDK detection (Vulkan SDK, etc.)
- Cross-platform builds from a single configuration
- Cross-compilation support (WSL, Docker, remote toolchains)
- Automatic generation of
.gitignore, CI workflows, and project files - File watching + hot-builds (looking at directory changes)
- User-level package cache (dependencies downloaded once, reused everywhere, basically package system)
- Unified compiler abstraction (translate flags between MSVC/GCC/Clang automatically)
- Distribution pipeline for packaging releases
- Integrated CTest support
- Automatic toolchain setup and discovery
- Automatic assets copy in distribution setups
- Multi-target / multi-architecture builds
- No manual SDK paths or environment setup required
What CMAKE does not do:
- Discover and configure SDKs automatically
- Set up cross-compilation environments
- Manage user-wide dependency caches
- Generate CI pipelines
- Create distribution workflows
- Watch files and rebuild automatically
- Normalize compiler flags across toolchains
- Configure Docker/WSL build environments
Why Add Another Layer On Top Of CMake:
- CMake is widely used, but it still leaves a lot of multi-platform build setup in the hands of the project author
- You still need to model targets, platform differences, toolchain choices, and common workflows in a way that stays manageable across environments
Why Build On Top Of CMake Instead Of Replacing It:
- Most third-party C and C++ libraries already support CMake
- Building on top of it means it stay compatible with the tooling and dependency ecosystem people already use
Maybe planned features:
- shader compilation
- custom asset compilation and pipeline support
- metaprogramming features built around the Clang AST
NOTE: THIS IS AN EXPERIMENTAL PROJECT NOT PRODUCTION READY OR ANYTHING
I would appreciate if you try it out, since i am trying to fix as many bugs as possible.
Thank you
8
Upvotes
17
u/Interesting_Buy_3969 Jun 02 '26 edited Jun 02 '26
so the build process becomes such:
make/ninjainvokes compiler and linkerwhy so many layers? That seems like overkill.
Edit: I don't hate it, no, it's actually a cool project, but I think generating CML.txt may not be the best choice because CMake is very high-level so I don't think anyone needs another layer on top of it.
7
u/brinza888 Jun 02 '26
Briefly checked repo.
Bad CMake files syntax is not a reason to build something on top of it. CMake already built on top of Make and VS project solutions.
5
u/Brisngr368 Jun 02 '26
Perfect another build system wrapper to wrap my build system wrappers
4
u/Rigamortus2005 Jun 02 '26
Everyone should just use bash to build their c programs
9
u/Ngtuanvy Jun 02 '26
Ah, the forbidden metameta-build system
4
u/ffd9k Jun 02 '26
Why not just use meson or muon?
1
u/stianhoiland Jun 03 '26
No one knows how to build down, aka. decompose, anymore.
2
u/lmemsm Jun 05 '26
I just use CDetect and GNU make for my builds. It's really easy to learn and a lot less complicated than cmake, GNU autotools or similar alternatives.
1
u/Western_Guitar_9007 Jun 02 '26
Vibe-coded CMake frontend for people that don’t want it done fast, love it! Slopmake would be a very catchy name, why are we going through so many layers?!
1
u/Maleficent_Memory831 Jun 02 '26
Frankly, no one really matches plain old Make so far. GNU make specifically with its improvements. CMake is just more complicated, unless you follow their style exactly. That's the big problem with many build systems, if you follow their templates it is easy, if you try to adapt to an existing project it is too inflexible unless you're willing to write a lot of code. There's a reason why many build systems just produce a Makefile at the end and use that.
Sure, it has tabs vs spaces. It's sort of like the complaint about indentation in Python. If the biggest thing to gripe about are these trivial things, then either you're not looking deep enough, or those are two very well done systems.
Where Make fails is when people rapidly try to use it before figuring out how to use it. It is too easy to write unmaintainable crap with it. Such as using it as a replacement for a shell script. Just like with programming, don't rush it to get past it and on to something more interesting.
0
u/[deleted] Jun 02 '26
[deleted] — view deleted comment
2
u/[deleted] Jun 02 '26
[removed] — view removed comment