This project is a build tool(kind of) for C/C++.
This project is heavily inspired by tsoding's nob.h.
The idea is simple.
I should be able to create c++ binary with only compiler. No cmake, No make, No visual studio, No anything but compiler.
clang is required if you don't want to edit the nobpp source code.
Note
I chose Clang as the compiler of choice for cross-platform support, but with some modifications to the source code, it can be configured to work with GCC, MSVC, or other compilers as needed.
Copy Paste the nobpp.hpp
to your project.
wget https://raw.githubusercontent.com/pekochan069/nobpp/refs/heads/main/nobpp.hpp
or
curl -o nobpp.hpp https://raw.githubusercontent.com/pekochan069/nobpp/refs/heads/main/nobpp.hpp
After that, write build script for your project.
// build.cpp or nobpp.cpp or whatever.cpp
#include "nobpp.hpp"
int main()
{
nobpp::CommandBuilder builder = nobpp::CommandBuilder();
builder.set_language(nobpp::Language::cpp)
.set_target_os(nobpp::TargetOS::windows)
.set_optimization_level(nobpp::OptimizationLevel::o3)
.add_options({"-ffast-math"})
.add_file("./test.cpp")
.add_build_dir("./bin")
.set_output("test")
.run();
}
nobpp
requires clang version which support c++14 or higher.
clang++ -std=c++14 -O3 build.cpp -o build.exe # On Windows
clang++ -std=c++14 -O3 build.cpp -o build # On Linux
After compilation, you can just run the executable and your project will be compiled.
- Windows
- Linux
- Executable
- Static Library
- Dynamic Library
- Command Queue
- Task