| CBuild
    C++ build system with scripts written in c++ | 
#include <gccmt.hpp>
 
  
| Public Member Functions | |
| GCCMT (std::string id) | |
| Construct a new GCCMT object. | |
| GCCMT (std::string id, std::string name) | |
| Construct a new GCCMT object. | |
|  Public Member Functions inherited from CBuild::Toolchain | |
| virtual std::string | gen_out_name (std::string executable=".run", std::string dyn_lib=".so", std::string stat_lib=".a") | 
| Generate output file name (after linking) | |
| virtual void | load_project_deps (std::string curr_path) | 
| Load all project dependencies. | |
| virtual void | stdargs () | 
| Add standard compile and link arguments into compilation Need to be publick for some hashers to work. | |
| Toolchain () | |
| virtual | ~Toolchain () | 
| std::string | get_id () | 
| virtual void | call (std::vector< std::string > *args, bool force=false, bool debug=false, bool dummy=false) | 
| Call tollchain to execute. | |
| virtual void | run (std::vector< std::string > *args) | 
| Run builded app. | |
| virtual void | debug (std::vector< std::string > *args, std::vector< std::string > *pargs) | 
| Build program in debug mode and after run gdb on it. | |
| virtual void | clear () | 
| Clear all caches and builded app. | |
| virtual void | add_define (std::string define, std::string val="") | 
| Add new define. | |
| virtual void | add_undef (std::string define) | 
| Add new undefine (undefine previvious define) | |
| virtual void | add_include (std::string include_path) | 
| Add compile-time include. | |
| virtual void | add_compile_arg (std::string arg) | 
| Directly add compiler argument. | |
| virtual void | add_link_arg (std::string arg) | 
| Add linker arguments. | |
| virtual void | add_library_include (std::string library) | 
| Add system library include, library include folder need to be in PATH. | |
| virtual void | add_library_dir (std::string include, std::string lib) | 
| Add library include directory (with *.h files) and directory with library *.a and *.so/*.dll files. | |
| virtual void | add_requirment (std::string task_, CBuild::stage run_stage=CBuild::PRE) | 
| Add required task, that task will be executed before toolchain, it can have dependecies, but toolchain can depend on multiple tasks also. | |
| virtual void | depends_on (std::string target) | 
| This target depends on other target. | |
| virtual void | warn () | 
| Enable more warnings. | |
| virtual void | static_analizer () | 
| Enable static anlizer (very slow) | |
| virtual void | error () | 
| Add -Werror. | |
| virtual void | multithreaded_target () | 
| Add -pthreadargument. | |
| virtual void | set_standart (std::string std_) | 
| Set standart for code (-std=std_) | |
| virtual void | add_file (std::string path) | 
| Add file for compilation. | |
| virtual void | add_folder (std::string path) | 
| Add folder to compile path, scan is not recursive. | |
| virtual void | set_type (CBuild::build_type type) | 
| Set the type of build. | |
| virtual void | depends_on_project (std::string path, std::string name, std::string id, std::string headers_path) | 
| Add another CBuild project as dependency. | |
| virtual void | set_profiling_mode () | 
| Enable -pgfor gprof. | |
| virtual void | set_version_major (int version) | 
| Set major version component, used in -Wl,-soname | |
| virtual std::array< std::string, 3 > | get_cmds () | 
| Get all three commands from class - compile, linker and packer. | |
| virtual lib::map< std::string, std::string > | gen_file_list_force () | 
| Generate list of all files, that is tracked by this target. | |
| virtual std::string | get_compile_args () | 
| Get preprocessed compile args. | |
| virtual void | crash () __attribute__((__noreturn__)) | 
| Crash compilation, needed when gcc throws error. | |
| virtual void | compile (std::string cmd) | 
| Call compiler. | |
| virtual void | add_pkgconfig_entry (std::string id) | 
| Add a lib, data for what need to be searched using pkg-config tool. | |
| virtual void | set_hasher (Hash *hasher) | 
| Set used hasher for this target. | |
| virtual void | set_name (std::string name) | 
| Change out file name. | |
| virtual void | set_id (std::string id) | 
| Change id of this toolchain, if done after registering it can brake things. | |
| void | add_external_dependency (CBuild::Dependency *dep) | 
| Add external dependency to this toolchain. | |
| Protected Member Functions | |
| void | build () override | 
| Build. | |
| void | link () override | 
| Linking. | |
| void | link_pack () override | 
| Linking for static libraries. | |
|  Protected Member Functions inherited from CBuild::Toolchain | |
| virtual void | pre_build () | 
| Before build. | |
| virtual void | post_build () | 
| After build. | |
| virtual void | pre_link () | 
| Before linking. | |
| virtual void | post_link () | 
| After linking. | |
| virtual lib::map< std::string, std::string > | gen_file_list (bool force) | 
| Generate list of files that need to be compiles. | |
| virtual std::string | gen_out_file (std::string file) | 
| Generate output object file from input file. | |
| virtual std::string | cmd_str (std::string in) | 
| Replace spaces by "\ ". | |
| virtual void | init () | 
| Initialize folder structure. | |
| Additional Inherited Members | |
|  Protected Attributes inherited from CBuild::Toolchain | |
| std::string | name = "" | 
| Name of output, if undefined (""), for id is used for binary name. | |
| std::string | id | 
| Must be initialized in derived classes. | |
| lib::map< std::string, CBuild::stage > | required | 
| Save task id with run stage sprecified for this task. | |
| std::vector< std::string > | depends | 
| All other targets, that is needed for this target. | |
| std::vector< CBuild::Path > | targets | 
| Target files or folders. | |
| std::vector< std::string > | compiler_args | 
| Compiler args (specified and generated) | |
| std::vector< std::string > | link_args | 
| Linker args (specified and generated) | |
| std::string | compiler | 
| Compiler command. | |
| std::string | linker | 
| Linker command. | |
| std::string | packer | 
| ar command for packing static libraries | |
| CBuild::build_type | build_type | 
| Type of build. | |
| std::vector< CBuild::Project_dependency > | project_deps | 
| Project dependencies. | |
| bool | dummy = false | 
| We do dummy compilation. | |
| int | version_major = -1 | 
| Major version, can be necesary for shared libraries. | |
| bool | gen_out_name_without_base_path = false | 
| gen_out_name() dont prepend base path | |
| bool | gen_file_list_for_linking = false | 
| Generate file list for linking - force and no changes to hashes. | |
| std::vector< std::string > | pkg_config_include_entries | 
| Libs that need to be searched in pkg-config. | |
| Hash * | hasher | 
| Hasher used here. | |
| std::vector< CBuild::Dependency * > | dependency_list | 
| Dependencies. | |
| std::vector< std::string > * | args | 
| Argument pointer (scratch variable) | |
| bool | force | 
| Force argument (scratch variable) | |
| bool | stdargs_lock = false | 
| Lock that specifies that stdargs() function need to do nothing. | |
| 
 | inline | 
Construct a new GCCMT object.
| id | Id | 
Definition at line 38 of file gccmt.hpp.
References CBuild::Toolchain::add_link_arg(), CBuild::Toolchain::compiler, CBuild::hash(), CBuild::Toolchain::hasher, CBuild::Toolchain::id, CBuild::Toolchain::linker, CBuild::Toolchain::name, and CBuild::Toolchain::packer.
| 
 | inline | 
Construct a new GCCMT object.
| id | Id | 
| name | Name | 
Definition at line 54 of file gccmt.hpp.
References CBuild::Toolchain::add_link_arg(), CBuild::Toolchain::compiler, CBuild::hash(), CBuild::Toolchain::hasher, CBuild::Toolchain::id, CBuild::Toolchain::linker, CBuild::Toolchain::name, and CBuild::Toolchain::packer.
| 
 | inlineoverrideprotectedvirtual | 
Build.
Implements CBuild::Toolchain.
Definition at line 67 of file gccmt.hpp.
References CBuild::Toolchain::args, CBuild::Toolchain::compile(), CBuild::Toolchain::compiler, CBuild::Toolchain::compiler_args, CBuild::Toolchain::force, and CBuild::Toolchain::gen_file_list().
| 
 | inlineoverrideprotectedvirtual | 
Linking.
Implements CBuild::Toolchain.
Definition at line 109 of file gccmt.hpp.
References CBuild::Toolchain::args, CBuild::Toolchain::compile(), CBuild::Toolchain::compiler, CBuild::Toolchain::force, CBuild::Toolchain::gen_file_list(), and CBuild::Toolchain::link_args.
| 
 | inlineoverrideprotectedvirtual | 
Linking for static libraries.
Implements CBuild::Toolchain.
Definition at line 150 of file gccmt.hpp.
References CBuild::Toolchain::args, CBuild::Toolchain::compile(), CBuild::Toolchain::gen_file_list(), CBuild::Toolchain::gen_file_list_for_linking, CBuild::Toolchain::gen_out_name(), CBuild::Toolchain::link_args, and CBuild::Toolchain::packer.