Yet another build system for C++.
This is a build system that uses cpp to build cpp project. It is highly customizable and is designed with support for C++20 modules in mind.
boost library is mandatory, this may change in the future
- Download the zip in release section.
- Extract all files into a folder. Think this folder as
node_modulesin js orsite-packagesin python. Assume the folder is named aspackages. - Set a env variable
CXX_PACKAGESand set the value topackages. - Add
packages/makeDotCpp/binintoPATH. - Follow the steps in Usage. The first build may be slow due to generation of BMI files for makeDotCpp.
The following steps maybe simplified in the future with make.cpp init command.
For now only clang compiler is supported to build build.cpp. This might change when global config file is supported.
- Create a file named
project.jsonunder your project.
Theproject.jsonin this project is a good example of it. You can find the full description insrc/project/ProjectDesc.cppmandsrc/project/Usage.cppm. - Create a file named
build.cpp(This can be controlled throughdev.buildFileinproject.json). - Add a function:
import makeDotCpp.dll.api; using namespace makeDotCpp; using namespace api; extern "C" int build(const ProjectContext &ctx) { };
- The
ProjectContextwill provide all information you will need. You can find the definition insrc/dll/api.cppm. - The
build.cppin this project is a good example of how to use makeDotCpp to build a project, however if you want you can build the project as you wish. - Simply type
make.cppto init a build. More options can be found inmake.cpp --help.
- All build files and global packages will be build with flags
-march=native -std=c++20 -Wall. Because the artifacts are not supposed to be shared with others. - For now only clang is supported to build
build.cppand global packages. However, the project may be compiled with other compilers, to do this, you need to inherit from Compiler class in makeDotCpp.compiler to create your own compiler implementation. Compile it as a dll and put the dll underpackages/.global/compiler. Then you may usemake.cpp --compiler <The name of dll>to build a project. cmakeand other build system compatibility is not yet implemented. However, to use a package from other build system, you may look atsrc/builder/Export.cppmto create your own implementations.