🟥 Minimal build system where builds are described in C++
Build uses C++ to imperatively describe a sequence of build operations.
🟥 Draft
Build currently used to generate test projects of this repository but still not mature enough to be used for anything else.
Build C++ files (named by convention SC-build.cpp
) are compiled the fly and they generate project files for existing build systems.
In the future the plan is to allow also the system to run standalone directly invoking compilers to produce libraries and executables. Projects are generated by invoking ./SC.sh build
or SC.bat build
.
SC.sh build
.This is for example the Tools/SC-build.cpp
file for the test suite:
The abstraction is described by the following (top-down) hierarchy:
Class | Description |
---|---|
SC::Build::Definition | Top level build description holding all Workspace objects. |
SC::Build::Workspace | Groups multiple Project together with shared compile and link flags. |
SC::Build::Project | Groups multiple Configuration and source files with their compile and link flags. |
SC::Build::Configuration | Groups SC::Build::CompileFlags and SC::Build::LinkFlags for a given SC::Build::Architecture. |
Some additional types allow describing detailed properties of the build:
Class | Description |
---|---|
SC::Build::Platform | Build Platform (Operating System) |
SC::Build::Architecture | Build Architecture (Processor / Instruction set) |
SC::Build::Generator | Build system generator (Xcode / Visual Studio) |
SC::Build::Optimization | Optimization level (Debug / Release) |
SC::Build::Compile | Compilation switches (include paths, preprocessor defines, etc.) |
SC::Build::CompileFlags | Map of SC::Build::Compile flags (include paths, preprocessor defines etc.) |
SC::Build::Link | Linking switches (library paths, LTO etc.) |
SC::Build::LinkFlags | Map of SC::Build::Link flags (library paths, LTO switch etc.) |
SC-build.cpp
files to his librarySC-build.cpp
describes the SC::Build::Definition using imperative C++ codeSC-build.cpp
is compiled to an executable with a single clang
or cl.exe
invocationSC.cpp
is linked together in the same invocationSC-build.cpp
calls SC::Build::ConfigurePresets::generateAllPlatforms or manually invokes SC::Build::Definition::generateSC.sh build
.So far the entire build configuration is created in C++ but each invocation with a different set of "build parameters" it's building a data structure that is free of conditionals, as they've been evaluated by the imperative code. Such "post-configure" build settings could be serialized to JSON (or using binary Serialization) or to any other declarative format if needed.
🟨 MVP Features:
🟩 Usable Features:
🟦 Complete Features:
💡 Unplanned Features: