CBuild
C++ build system with scripts written in c++
Loading...
Searching...
No Matches
CBuild_help_task.hpp
Go to the documentation of this file.
1
22// Include c++ libraries
23#include "string"
24// Include CBuild headers
25#include "../print.hpp"
26#include "Task.hpp"
27namespace CBuild {
28class Help : public CBuild::Task {
29 private:
30 std::string data = "CBuild help - v13.0\nCommand line options:\n\t `-f` - force recompilation of all files.\n\t `-v` - verbose output, some addition info and some debugging info, mask `--no-cli-out` if used before.\n\t `--no-cli-out` - no output from CBuild at all, mask `-v` if used before.\n\t `-g make` - generate Makefile based on output from CBuild, simly log all executed command and pack it in Makefile syntax, so, sadly, CBuild::fs calls not propagate to Makefile.\n\t `-g ccj` - generate compile_commands.json, use internal command evaluator in CBuild::Toolchain, from the box work only for toolchains, that use standard compiler calling convention, see below.\n\t `-ld <toolchain_name>` - load dependencies of specified target, only for CBuild dependencies.\n\t `-b <toolchain_name>` - build specified target.\n\t `-b all` - build all registered targets\n\t `-r <toolchain_name>` - run specified target.\n\t `-br <toolchain_name>` - build and then run specified target.\n\t `-d <toolchain_name>` - build and then run specified target in debug mode. Now work only with gdb on linux.\n\t `-c <toolchain_name>` - clear all data of specified target.\n\t `-t <task_name>` - run specified task.\n\t `-a <arg>` - set some argument (see it as #define arg, without value). It can be used by ran toolchain or ran task. No preprocessing, simple propagation for user-defined arguments, preserver order in what arguments is specified.\n\t `-pa <arg>` - specify argument for ran app, propagated to app ran by `-r` and `-br`, in `-d` arguments propagates to debugger.\n\t `--rebuild` - rebuild CBuild executable.\n\t `--init` - init CBuild folder structure, not always required.\n\t `--help` - print help message - this information.\n\t `--version` - print curent version of CBuild\n\t `--task-list` - print list of all registered tasks\n\t `--target-list` - print list of all registered targets\n\t `--generator-list` - print list of all registered generators\n\t `--commands-list` - print list of all registered user commands\nCBuild folder structure: \n<project_root>\n |\n | - src : Project sources folder\n | |\n | | - main.cpp : Have main() function of project implemented\n |\n | - scripts\n | |\n | | - main.cpp : Main file of CBuild user scripts, init CBuild and call user init\n | | - user_init.cpp : Implement user init function, have build sript implemented\n | | - user_init.hpp : Header to glue together two .cpp files\n | - cache : CBuild dir for some temporary data\n | |\n | | - headers : Header of included CBuild projects\n | | - libs : .so / .a files of included CBuild projects\n | | - tmp : Directory for temporary runtime data of CBuild \n |\n | - build\n | |\n | | - <toolchain_name>\n | | | - config : Hash storage directory\n | | | |\n | | | | - src.main.meta : Metadata for src/main.cpp\n | | | - objs : Saved .o files of specified target\n | | | - out : Output files of specified target\n | | | - <toolchain_name>.meta : Metadata for a full target\n |\n | - CBuild.run : Main executable of CBuild\nSome useful information: \n Compiler calling convention:: \n\t - All compilations is done in two steps: compilation `<compiler> -c <file> <arguments> -o <object>` and then linking `<linker> <objects> <arguments> -o <output binary>`\n Hasher general requirments: \n\t - All hashers are inherited of CBuild::Hash class. \n\t - Class constructor need to take one argument of type std::string and pass it to a base class. \n\t - Function 'get_files_for_recompilation' need to construct a `lib::map<std::string, std::string>` of source->object mappings of files that need to be recompiled, files and objects array are for one set of files, `objects.at(1)` is an object for a source file at `files.at(1)`. So, this function need to produce a list of files that need to be recompiled and update stored metadata. \n\t - All other function need to return an int value acording to their doxygen docs and also update a coresponding metadata value. \n";
31
32 public:
33 Help() : CBuild::Task("CBuild_help", {}) {};
34 void call(std::vector<std::string> args) {
36 }
37};
38} // namespace CBuild
Task main class.
void call(std::vector< std::string > args)
Executed on task call.
Task, can be runned from shell or code.
Definition Task.hpp:32
Filebuffer for CBuild ecosystem.
Definition Build.hpp:34
void print(std::string msg, color fg=CBuild::WHITE)
Print colored text to STDOUT.
Definition print.cpp:70
Custom print that support color codes.