|
CBuild
C++ build system with scripts written in c++
|
Public Member Functions | |
| ConfigToolchain () | |
| void | call (std::vector< std::string > *args, bool force=false, bool debug=false, bool dummy=false) override |
| Call tollchain to execute. | |
| void | debug (std::vector< std::string > *args, std::vector< std::string > *pargs) override |
| Build program in debug mode and after run gdb on it. | |
| void | clear () override |
| Clear all caches and builded app. | |
| void | init () override |
| Initialize folder structure. | |
| void | run (std::vector< std::string > *args) override |
| Run builded app. | |
| void | pre_build () override |
| Before build. | |
| void | build () override |
| Build. | |
| void | post_build () override |
| After build. | |
| void | pre_link () override |
| Before linking. | |
| void | link_pack () override |
| Linking for static libraries. | |
| void | link () override |
| Linking. | |
| void | post_link () override |
| After linking. | |
| void | stdargs () override |
| Add standard compile and link arguments into compilation Need to be publick for some hashers to work. | |
| void | compile (std::string cmd) override |
| Call compiler. | |
| void | load_project_deps (std::string curr_path) override |
| Load all project dependencies. | |
| std::array< std::string, 3 > | get_cmds () override |
| Get all three commands from class - compile, linker and packer. | |
| void | set_id (std::string id) override |
| Change id of this toolchain, if done after registering it can brake things. | |
| void | set_name (std::string name) override |
| Change out file name. | |
| void | set_version_major (int version) override |
Set major version component, used in -Wl,-soname | |
| void | set_type (CBuild::build_type type) override |
| Set the type of build. | |
| void | clone_config (CBuild::Toolchain *tool) |
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) | |
| Toolchain () | |
| virtual | ~Toolchain () |
| std::string | get_id () |
| 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 -pthread argument. | |
| 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 | 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 -pg for gprof. | |
| 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 | 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. | |
| void | add_external_dependency (CBuild::Dependency *dep) |
| Add external dependency to this toolchain. | |
Protected Attributes | |
| bool | type_set |
| bool | vmajor_set |
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. | |
Additional Inherited Members | |
Protected Member Functions inherited from CBuild::Toolchain | |
| 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 "\ ". | |
Definition at line 35 of file cross_compile.cpp.
|
inline |
Definition at line 41 of file cross_compile.cpp.
References CBuild::Toolchain::hasher, type_set, and vmajor_set.
|
inlineoverridevirtual |
Build.
Implements CBuild::Toolchain.
Definition at line 71 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Call tollchain to execute.
| args | => std::vector<std::string>* -> argument for call, pointer, nonull |
| force | => bool -> force argument, used internally |
| debug | => bool -> does we run in build mode |
| dummy | => bool -> we dont build - we run this to evalueate all things |
Reimplemented from CBuild::Toolchain.
Definition at line 46 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Clear all caches and builded app.
Reimplemented from CBuild::Toolchain.
Definition at line 55 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inline |
Definition at line 131 of file cross_compile.cpp.
References CBuild::Toolchain::add_compile_arg(), CBuild::Toolchain::add_external_dependency(), CBuild::Toolchain::add_file(), CBuild::Toolchain::add_folder(), CBuild::Toolchain::add_link_arg(), CBuild::Toolchain::add_pkgconfig_entry(), CBuild::Toolchain::add_requirment(), CBuild::Toolchain::compiler_args, CBuild::Toolchain::dependency_list, CBuild::Toolchain::depends, CBuild::Toolchain::depends_on(), CBuild::Toolchain::depends_on_project(), CBuild::Toolchain::hasher, CBuild::Toolchain::link_args, CBuild::Toolchain::pkg_config_include_entries, CBuild::Toolchain::project_deps, CBuild::Toolchain::required, CBuild::Toolchain::set_hasher(), CBuild::Toolchain::set_type(), CBuild::Toolchain::set_version_major(), CBuild::Toolchain::targets, and CBuild::Toolchain::version_major.
|
inlineoverridevirtual |
Call compiler.
| cmd | => std::string -> Shell command |
Reimplemented from CBuild::Toolchain.
Definition at line 99 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Build program in debug mode and after run gdb on it.
| args | => std::vector<std::string>* -> arguments for build |
| pargs | => std::vector<std::string>* -> arguments for run |
Reimplemented from CBuild::Toolchain.
Definition at line 51 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Get all three commands from class - compile, linker and packer.
Reimplemented from CBuild::Toolchain.
Definition at line 107 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Initialize folder structure.
Reimplemented from CBuild::Toolchain.
Definition at line 59 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Linking.
Implements CBuild::Toolchain.
Definition at line 87 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Linking for static libraries.
Implements CBuild::Toolchain.
Definition at line 83 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Load all project dependencies.
| curr_path | => std::string -> current path |
Reimplemented from CBuild::Toolchain.
Definition at line 103 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
After build.
Reimplemented from CBuild::Toolchain.
Definition at line 75 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
After linking.
Reimplemented from CBuild::Toolchain.
Definition at line 91 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Before build.
Reimplemented from CBuild::Toolchain.
Definition at line 67 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Before linking.
Reimplemented from CBuild::Toolchain.
Definition at line 79 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Run builded app.
| args | => std::vector<std::string>* -> program arguments |
Reimplemented from CBuild::Toolchain.
Definition at line 63 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Change id of this toolchain, if done after registering it can brake things.
| id | => std::string -> New id |
Reimplemented from CBuild::Toolchain.
Definition at line 111 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Change out file name.
| name | => std::string -> Out name |
Reimplemented from CBuild::Toolchain.
Definition at line 117 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
inlineoverridevirtual |
Set the type of build.
| type | Build type |
Reimplemented from CBuild::Toolchain.
Definition at line 127 of file cross_compile.cpp.
|
inlineoverridevirtual |
Set major version component, used in -Wl,-soname
| version | => int -> Major version |
Reimplemented from CBuild::Toolchain.
Definition at line 123 of file cross_compile.cpp.
References CBuild::version, and CBuild::Toolchain::version_major.
|
inlineoverridevirtual |
Add standard compile and link arguments into compilation Need to be publick for some hashers to work.
Reimplemented from CBuild::Toolchain.
Definition at line 95 of file cross_compile.cpp.
References CBuild::exit(), CBuild::print(), and CBuild::RED.
|
protected |
Definition at line 37 of file cross_compile.cpp.
Referenced by ConfigToolchain().
|
protected |
Definition at line 38 of file cross_compile.cpp.
Referenced by ConfigToolchain().