CBuild
C++ build system with scripts written in c++
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CBuild::Toolchain Class Referenceabstract

Toolchain class. More...

#include <Build.hpp>

Inheritance diagram for CBuild::Toolchain:
CBuild::CLANG< hash > CBuild::CLANGMT< hash > CBuild::CLANGXX< hash > CBuild::CLANGXXMT< hash > CBuild::ConfigToolchain CBuild::GCC< hash > CBuild::GCCMT< hash > CBuild::GXX< hash > CBuild::GXXMT< hash > CBuild::MINGW_GCC< hash > CBuild::MINGW_GCCMT< hash > CBuild::MINGW_GXX< hash > CBuild::MINGW_GXXMT< hash > CBuild::MetaToolchain CBuild::SimpleToolchain< hash >

Public Member Functions

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 -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 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 -pg for 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

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 void build ()=0
 Build.
 
virtual void link ()=0
 Linking.
 
virtual void link_pack ()=0
 Linking for static libraries.
 
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.
 

Protected Attributes

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::stagerequired
 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::Pathtargets
 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_dependencyproject_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.
 
Hashhasher
 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.
 

Detailed Description

Toolchain class.

Definition at line 65 of file Build.hpp.

Constructor & Destructor Documentation

◆ Toolchain()

CBuild::Toolchain::Toolchain ( )
inline

Definition at line 242 of file Build.hpp.

◆ ~Toolchain()

virtual CBuild::Toolchain::~Toolchain ( )
inlinevirtual

Definition at line 243 of file Build.hpp.

Member Function Documentation

◆ add_compile_arg()

void CBuild::Toolchain::add_compile_arg ( std::string arg)
virtual

Directly add compiler argument.

Parameters
arg=> std:string -> argument, directly passed to compiler

Definition at line 38 of file Build.cpp.

References CBuild::arg, and compiler_args.

Referenced by CBuild::Registry::AddCompileArg(), CBuild::ConfigToolchain::clone_config(), and CBuild::Registry::init().

◆ add_define()

void CBuild::Toolchain::add_define ( std::string define,
std::string val = "" )
virtual

Add new define.

Parameters
define=> std:string -> Define name
val=> std:string -> Value for define, default - ""

Definition at line 50 of file Build.cpp.

◆ add_external_dependency()

void CBuild::Toolchain::add_external_dependency ( CBuild::Dependency * dep)

Add external dependency to this toolchain.

Parameters
dep=> CBuild::Dependency* -> Dependency

Definition at line 172 of file Build.cpp.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ add_file()

void CBuild::Toolchain::add_file ( std::string path)
virtual

Add file for compilation.

Parameters
path=> std::string -> Path to file

Definition at line 176 of file Build.cpp.

References CBuild::Path::folder, and CBuild::Path::path.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ add_folder()

void CBuild::Toolchain::add_folder ( std::string path)
virtual

Add folder to compile path, scan is not recursive.

Parameters
path=> std::string -> Path to folder

Definition at line 187 of file Build.cpp.

References CBuild::Path::folder, and CBuild::Path::path.

Referenced by CBuild::ConfigToolchain::clone_config(), and CBuild::Registry::init().

◆ add_include()

void CBuild::Toolchain::add_include ( std::string include_path)
virtual

Add compile-time include.

Parameters
include_path=> std:string -> path for include

Definition at line 73 of file Build.cpp.

◆ add_library_dir()

void CBuild::Toolchain::add_library_dir ( std::string include,
std::string lib )
virtual

Add library include directory (with *.h files) and directory with library *.a and *.so/*.dll files.

Parameters
include=> std:string -> include dir, will be used as -I<include>
lib=> std:string -> library dir, will be used as -L<lib>

Definition at line 92 of file Build.cpp.

◆ add_library_include()

void CBuild::Toolchain::add_library_include ( std::string library)
virtual

Add system library include, library include folder need to be in PATH.

Parameters
library=> std:string -> library name, will be used as -l<library>

Definition at line 83 of file Build.cpp.

Referenced by CBuild::Registry::init().

◆ add_link_arg()

void CBuild::Toolchain::add_link_arg ( std::string arg)
virtual

◆ add_pkgconfig_entry()

void CBuild::Toolchain::add_pkgconfig_entry ( std::string id)
virtual

Add a lib, data for what need to be searched using pkg-config tool.

Parameters
id=> std::string -> Package id in a pkg-config database

Definition at line 160 of file Build.cpp.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ add_requirment()

void CBuild::Toolchain::add_requirment ( std::string task_,
CBuild::stage run_stage = CBuild::PRE )
virtual

Add required task, that task will be executed before toolchain, it can have dependecies, but toolchain can depend on multiple tasks also.

Parameters
task_=> std:string -> task id
run_stage=> CBuild::stage -> run stage of task

Definition at line 104 of file Build.cpp.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ add_undef()

void CBuild::Toolchain::add_undef ( std::string define)
virtual

Add new undefine (undefine previvious define)

Parameters
define=> std::string -> Define name

Definition at line 64 of file Build.cpp.

◆ build()

virtual void CBuild::Toolchain::build ( )
protectedpure virtual

◆ call()

void CBuild::Toolchain::call ( std::vector< std::string > * args,
bool force = false,
bool debug = false,
bool dummy = false )
virtual

Call tollchain to execute.

Parameters
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 in CBuild::ConfigToolchain, and CBuild::MetaToolchain.

Definition at line 572 of file Build.cpp.

References CBuild::Registry::CallTask(), CBUILD_BUILD_DIR, CBUILD_BUILD_OUT_DIR, CBuild::DYNAMIC_LIBRARY, CBuild::Registry::GetToolchain(), CBuild::GREEN, CBuild::MAGENTA, CBuild::POST, CBuild::PRE, CBuild::print(), CBuild::RED, CBuild::STATIC_LIBRARY, and CBuild::system().

Referenced by CBuild::MetaToolchain::call(), and CBuild::loop().

◆ clear()

void CBuild::Toolchain::clear ( )
virtual

Clear all caches and builded app.

Reimplemented in CBuild::ConfigToolchain, and CBuild::MetaToolchain.

Definition at line 723 of file Build.cpp.

References CBUILD_BUILD_DIR, and CBuild::system().

Referenced by CBuild::MetaToolchain::clear(), and CBuild::loop().

◆ cmd_str()

std::string CBuild::Toolchain::cmd_str ( std::string in)
protectedvirtual

Replace spaces by "\ ".

Parameters
in=> std::string -> input string
Returns
std::string Returned string

Definition at line 443 of file Build.cpp.

Referenced by CBuild::MINGW_GXX< hash >::gen_out_name(), CBuild::MINGW_GXXMT< hash >::gen_out_name(), CBuild::MINGW_GCC< hash >::gen_out_name(), and CBuild::MINGW_GCCMT< hash >::gen_out_name().

◆ compile()

void CBuild::Toolchain::compile ( std::string cmd)
virtual

Call compiler.

Parameters
cmd=> std::string -> Shell command

Reimplemented in CBuild::ConfigToolchain.

Definition at line 504 of file Build.cpp.

References CBuild::system().

Referenced by CBuild::CLANGXX< hash >::build(), CBuild::CLANGXXMT< hash >::build(), CBuild::CLANG< hash >::build(), CBuild::CLANGMT< hash >::build(), CBuild::GXX< hash >::build(), CBuild::GXXMT< hash >::build(), CBuild::GCC< hash >::build(), CBuild::GCCMT< hash >::build(), CBuild::MINGW_GXX< hash >::build(), CBuild::MINGW_GXXMT< hash >::build(), CBuild::MINGW_GCC< hash >::build(), CBuild::MINGW_GCCMT< hash >::build(), CBuild::SimpleToolchain< hash >::build(), CBuild::CLANGXX< hash >::link(), CBuild::CLANGXXMT< hash >::link(), CBuild::CLANG< hash >::link(), CBuild::CLANGMT< hash >::link(), CBuild::GXX< hash >::link(), CBuild::GXXMT< hash >::link(), CBuild::GCC< hash >::link(), CBuild::GCCMT< hash >::link(), CBuild::MINGW_GXX< hash >::link(), CBuild::MINGW_GXXMT< hash >::link(), CBuild::MINGW_GCC< hash >::link(), CBuild::MINGW_GCCMT< hash >::link(), CBuild::SimpleToolchain< hash >::link(), CBuild::CLANGXX< hash >::link_pack(), CBuild::CLANGXXMT< hash >::link_pack(), CBuild::CLANG< hash >::link_pack(), CBuild::CLANGMT< hash >::link_pack(), CBuild::GXX< hash >::link_pack(), CBuild::GXXMT< hash >::link_pack(), CBuild::GCC< hash >::link_pack(), CBuild::GCCMT< hash >::link_pack(), CBuild::MINGW_GXX< hash >::link_pack(), CBuild::MINGW_GXXMT< hash >::link_pack(), CBuild::MINGW_GCC< hash >::link_pack(), CBuild::MINGW_GCCMT< hash >::link_pack(), and CBuild::SimpleToolchain< hash >::link_pack().

◆ crash()

void CBuild::Toolchain::crash ( )
virtual

Crash compilation, needed when gcc throws error.

Definition at line 500 of file Build.cpp.

References CBuild::exit(), CBuild::print(), and CBuild::RED.

◆ debug()

void CBuild::Toolchain::debug ( std::vector< std::string > * args,
std::vector< std::string > * pargs )
virtual

Build program in debug mode and after run gdb on it.

Parameters
args=> std::vector<std::string>* -> arguments for build
pargs=> std::vector<std::string>* -> arguments for run

Reimplemented in CBuild::ConfigToolchain, CBuild::MetaToolchain, CBuild::MINGW_GXX< hash >, CBuild::MINGW_GXXMT< hash >, CBuild::MINGW_GCC< hash >, and CBuild::MINGW_GCCMT< hash >.

Definition at line 698 of file Build.cpp.

References CBuild::GREEN, CBuild::MAGENTA, CBuild::print(), CBuild::RED, and CBuild::system().

Referenced by CBuild::MetaToolchain::debug(), and CBuild::loop().

◆ depends_on()

void CBuild::Toolchain::depends_on ( std::string target)
virtual

This target depends on other target.

Parameters
target=> std::string -> Other target id

Definition at line 136 of file Build.cpp.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ depends_on_project()

void CBuild::Toolchain::depends_on_project ( std::string path,
std::string name,
std::string id,
std::string headers_path )
virtual

Add another CBuild project as dependency.

Parameters
path=> std::string -> Relative (from CBuild.run) path to needed toolchain
name=> std::string -> name of build target (for lib linking)
id=> std::string -> Id of needed toolchain for calling target build
headers_path=> std::string -> path to headers dir
Deprecated
Old, better ways exists

Definition at line 140 of file Build.cpp.

References CBuild::Project_dependency::headers_path, CBuild::Project_dependency::id, CBuild::Project_dependency::name, and CBuild::Project_dependency::path.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ error()

void CBuild::Toolchain::error ( )
virtual

Add -Werror.

Definition at line 122 of file Build.cpp.

◆ gen_file_list()

lib::map< std::string, std::string > CBuild::Toolchain::gen_file_list ( bool force)
protectedvirtual

Generate list of files that need to be compiles.

Parameters
force=> bool -> Do we do force compilation
Returns
lib::map<std::string, std::string> -> list of files, key - code, value - object

Definition at line 216 of file Build.cpp.

References lib::map< _K, _D >::at(), lib::map< _K, _D >::clear(), CBuild::fs::dir(), CBuild::fs::normalize_relative_path(), CBuild::print_full(), lib::map< _K, _D >::push_back(), and lib::map< _K, _D >::size().

Referenced by CBuild::CLANGXX< hash >::build(), CBuild::CLANGXXMT< hash >::build(), CBuild::CLANG< hash >::build(), CBuild::CLANGMT< hash >::build(), CBuild::GXX< hash >::build(), CBuild::GXXMT< hash >::build(), CBuild::GCC< hash >::build(), CBuild::GCCMT< hash >::build(), CBuild::MINGW_GXX< hash >::build(), CBuild::MINGW_GXXMT< hash >::build(), CBuild::MINGW_GCC< hash >::build(), CBuild::MINGW_GCCMT< hash >::build(), CBuild::SimpleToolchain< hash >::build(), CBuild::CLANGXX< hash >::link(), CBuild::CLANGXXMT< hash >::link(), CBuild::CLANG< hash >::link(), CBuild::CLANGMT< hash >::link(), CBuild::GXX< hash >::link(), CBuild::GXXMT< hash >::link(), CBuild::GCC< hash >::link(), CBuild::GCCMT< hash >::link(), CBuild::MINGW_GXX< hash >::link(), CBuild::MINGW_GXXMT< hash >::link(), CBuild::MINGW_GCC< hash >::link(), CBuild::MINGW_GCCMT< hash >::link(), CBuild::SimpleToolchain< hash >::link(), CBuild::CLANGXX< hash >::link_pack(), CBuild::CLANGXXMT< hash >::link_pack(), CBuild::CLANG< hash >::link_pack(), CBuild::CLANGMT< hash >::link_pack(), CBuild::GXX< hash >::link_pack(), CBuild::GXXMT< hash >::link_pack(), CBuild::GCC< hash >::link_pack(), CBuild::GCCMT< hash >::link_pack(), CBuild::MINGW_GXX< hash >::link_pack(), CBuild::MINGW_GXXMT< hash >::link_pack(), CBuild::MINGW_GCC< hash >::link_pack(), CBuild::MINGW_GCCMT< hash >::link_pack(), and CBuild::SimpleToolchain< hash >::link_pack().

◆ gen_file_list_force()

lib::map< std::string, std::string > CBuild::Toolchain::gen_file_list_force ( )
virtual

Generate list of all files, that is tracked by this target.

Returns
lib::map<std::string, std::string> -> List of files

Definition at line 379 of file Build.cpp.

◆ gen_out_file()

std::string CBuild::Toolchain::gen_out_file ( std::string file)
protectedvirtual

Generate output object file from input file.

Parameters
file=> std::string -> input file
Returns
std::string -> file path

Definition at line 199 of file Build.cpp.

References CBUILD_BUILD_CACHE_DIR, and CBUILD_BUILD_DIR.

◆ gen_out_name()

std::string CBuild::Toolchain::gen_out_name ( std::string executable = ".run",
std::string dyn_lib = ".so",
std::string stat_lib = ".a" )
virtual

◆ get_cmds()

std::array< std::string, 3 > CBuild::Toolchain::get_cmds ( )
virtual

Get all three commands from class - compile, linker and packer.

Returns
std::array<std::string, 3> -> Compiler, linker, packer

Reimplemented in CBuild::ConfigToolchain, and CBuild::MetaToolchain.

Definition at line 497 of file Build.cpp.

◆ get_compile_args()

std::string CBuild::Toolchain::get_compile_args ( )
virtual

Get preprocessed compile args.

Definition at line 386 of file Build.cpp.

References CBuild::arg.

◆ get_id()

std::string CBuild::Toolchain::get_id ( )
inline

Definition at line 244 of file Build.hpp.

References id.

Referenced by CBuild::Registry::RegisterTarget().

◆ init()

void CBuild::Toolchain::init ( )
protectedvirtual

◆ link()

virtual void CBuild::Toolchain::link ( )
protectedpure virtual

◆ link_pack()

virtual void CBuild::Toolchain::link_pack ( )
protectedpure virtual

◆ load_project_deps()

void CBuild::Toolchain::load_project_deps ( std::string curr_path)
virtual

Load all project dependencies.

Parameters
curr_path=> std::string -> current path

Reimplemented in CBuild::ConfigToolchain, and CBuild::MetaToolchain.

Definition at line 478 of file Build.cpp.

References CBUILD_BUILD_DIR, CBUILD_BUILD_OUT_DIR, CBUILD_CACHE_DIR, CBUILD_PROJECT_DEPS_DIR, CBUILD_PROJECT_DEPS_HEADERS, and CBuild::system().

Referenced by CBuild::MetaToolchain::load_project_deps(), and CBuild::loop().

◆ multithreaded_target()

void CBuild::Toolchain::multithreaded_target ( )
virtual

Add -pthread argument.

Definition at line 156 of file Build.cpp.

◆ post_build()

virtual void CBuild::Toolchain::post_build ( )
inlineprotectedvirtual

After build.

Reimplemented in CBuild::ConfigToolchain.

Definition at line 168 of file Build.hpp.

◆ post_link()

virtual void CBuild::Toolchain::post_link ( )
inlineprotectedvirtual

◆ pre_build()

virtual void CBuild::Toolchain::pre_build ( )
inlineprotectedvirtual

Before build.

Reimplemented in CBuild::ConfigToolchain.

Definition at line 164 of file Build.hpp.

◆ pre_link()

virtual void CBuild::Toolchain::pre_link ( )
inlineprotectedvirtual

Before linking.

Reimplemented in CBuild::ConfigToolchain.

Definition at line 172 of file Build.hpp.

◆ run()

void CBuild::Toolchain::run ( std::vector< std::string > * args)
virtual

Run builded app.

Parameters
args=> std::vector<std::string>* -> program arguments

Reimplemented in CBuild::ConfigToolchain, CBuild::MetaToolchain, CBuild::MINGW_GXX< hash >, and CBuild::MINGW_GXXMT< hash >.

Definition at line 677 of file Build.cpp.

References CBuild::MAGENTA, CBuild::print(), CBuild::RED, and CBuild::system().

Referenced by CBuild::loop(), and CBuild::MetaToolchain::run().

◆ set_hasher()

void CBuild::Toolchain::set_hasher ( CBuild::Hash * hasher)
virtual

Set used hasher for this target.

Parameters
hasher=> Hash* -> Hasher that need to be used

Definition at line 163 of file Build.cpp.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ set_id()

void CBuild::Toolchain::set_id ( std::string id)
virtual

Change id of this toolchain, if done after registering it can brake things.

Parameters
id=> std::string -> New id

Reimplemented in CBuild::ConfigToolchain.

Definition at line 169 of file Build.cpp.

Referenced by CBuild::CrossCompiler::add_arch_tool().

◆ set_name()

void CBuild::Toolchain::set_name ( std::string name)
virtual

Change out file name.

Parameters
name=> std::string -> Out name

Reimplemented in CBuild::ConfigToolchain.

Definition at line 166 of file Build.cpp.

Referenced by CBuild::CrossCompiler::add_arch_tool(), and CBuild::Registry::SetRebuildName().

◆ set_profiling_mode()

void CBuild::Toolchain::set_profiling_mode ( )
virtual

Enable -pg for gprof.

Definition at line 149 of file Build.cpp.

◆ set_standart()

void CBuild::Toolchain::set_standart ( std::string std_)
virtual

Set standart for code (-std=std_)

Parameters
std_=> std::string -> Stadart name

Definition at line 126 of file Build.cpp.

Referenced by CBuild::Registry::init().

◆ set_type()

void CBuild::Toolchain::set_type ( CBuild::build_type type)
virtual

Set the type of build.

Parameters
typeBuild type

Reimplemented in CBuild::ConfigToolchain.

Definition at line 133 of file Build.cpp.

Referenced by CBuild::ConfigToolchain::clone_config(), and CBuild::Registry::init().

◆ set_version_major()

void CBuild::Toolchain::set_version_major ( int version)
virtual

Set major version component, used in -Wl,-soname

Parameters
version=> int -> Major version

Reimplemented in CBuild::ConfigToolchain.

Definition at line 153 of file Build.cpp.

References CBuild::version.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ static_analizer()

void CBuild::Toolchain::static_analizer ( )
virtual

Enable static anlizer (very slow)

Definition at line 117 of file Build.cpp.

◆ stdargs()

void CBuild::Toolchain::stdargs ( )
virtual

◆ warn()

void CBuild::Toolchain::warn ( )
virtual

Enable more warnings.

Definition at line 110 of file Build.cpp.

Referenced by CBuild::Registry::init().

Member Data Documentation

◆ args

std::vector<std::string>* CBuild::Toolchain::args
protected

Argument pointer (scratch variable)

Definition at line 149 of file Build.hpp.

Referenced by CBuild::CLANGXX< hash >::build(), CBuild::CLANGXXMT< hash >::build(), CBuild::CLANG< hash >::build(), CBuild::CLANGMT< hash >::build(), CBuild::GXX< hash >::build(), CBuild::GXXMT< hash >::build(), CBuild::GCC< hash >::build(), CBuild::GCCMT< hash >::build(), CBuild::MINGW_GXX< hash >::build(), CBuild::MINGW_GXXMT< hash >::build(), CBuild::MINGW_GCC< hash >::build(), CBuild::MINGW_GCCMT< hash >::build(), CBuild::SimpleToolchain< hash >::build(), CBuild::MetaToolchain::call(), CBuild::MetaToolchain::debug(), CBuild::CLANGXX< hash >::link(), CBuild::CLANGXXMT< hash >::link(), CBuild::CLANG< hash >::link(), CBuild::CLANGMT< hash >::link(), CBuild::GXX< hash >::link(), CBuild::GXXMT< hash >::link(), CBuild::GCC< hash >::link(), CBuild::GCCMT< hash >::link(), CBuild::MINGW_GXX< hash >::link(), CBuild::MINGW_GXXMT< hash >::link(), CBuild::MINGW_GCC< hash >::link(), CBuild::MINGW_GCCMT< hash >::link(), CBuild::SimpleToolchain< hash >::link(), CBuild::CLANGXX< hash >::link_pack(), CBuild::CLANGXXMT< hash >::link_pack(), CBuild::CLANG< hash >::link_pack(), CBuild::CLANGMT< hash >::link_pack(), CBuild::GXX< hash >::link_pack(), CBuild::GXXMT< hash >::link_pack(), CBuild::GCC< hash >::link_pack(), CBuild::GCCMT< hash >::link_pack(), CBuild::MINGW_GXX< hash >::link_pack(), CBuild::MINGW_GXXMT< hash >::link_pack(), CBuild::MINGW_GCC< hash >::link_pack(), CBuild::MINGW_GCCMT< hash >::link_pack(), CBuild::SimpleToolchain< hash >::link_pack(), CBuild::MetaToolchain::run(), CBuild::MINGW_GXX< hash >::run(), and CBuild::MINGW_GXXMT< hash >::run().

◆ build_type

CBuild::build_type CBuild::Toolchain::build_type
protected

Type of build.

Definition at line 110 of file Build.hpp.

◆ compiler

std::string CBuild::Toolchain::compiler
protected

Compiler command.

Definition at line 98 of file Build.hpp.

Referenced by CBuild::CLANGXX< hash >::build(), CBuild::CLANGXXMT< hash >::build(), CBuild::CLANG< hash >::build(), CBuild::CLANGMT< hash >::build(), CBuild::GXX< hash >::build(), CBuild::GXXMT< hash >::build(), CBuild::GCC< hash >::build(), CBuild::GCCMT< hash >::build(), CBuild::MINGW_GXX< hash >::build(), CBuild::MINGW_GXXMT< hash >::build(), CBuild::MINGW_GCC< hash >::build(), CBuild::MINGW_GCCMT< hash >::build(), CBuild::SimpleToolchain< hash >::build(), CBuild::CLANG< hash >::CLANG(), CBuild::CLANG< hash >::CLANG(), CBuild::CLANGMT< hash >::CLANGMT(), CBuild::CLANGMT< hash >::CLANGMT(), CBuild::CLANGXX< hash >::CLANGXX(), CBuild::CLANGXX< hash >::CLANGXX(), CBuild::CLANGXXMT< hash >::CLANGXXMT(), CBuild::CLANGXXMT< hash >::CLANGXXMT(), CBuild::GCC< hash >::GCC(), CBuild::GCC< hash >::GCC(), CBuild::GCCMT< hash >::GCCMT(), CBuild::GCCMT< hash >::GCCMT(), CBuild::GXX< hash >::GXX(), CBuild::GXX< hash >::GXX(), CBuild::GXXMT< hash >::GXXMT(), CBuild::GXXMT< hash >::GXXMT(), CBuild::CLANGMT< hash >::link(), CBuild::GCCMT< hash >::link(), CBuild::MINGW_GCC< hash >::MINGW_GCC(), CBuild::MINGW_GCC< hash >::MINGW_GCC(), CBuild::MINGW_GCCMT< hash >::MINGW_GCCMT(), CBuild::MINGW_GCCMT< hash >::MINGW_GCCMT(), CBuild::MINGW_GXX< hash >::MINGW_GXX(), CBuild::MINGW_GXX< hash >::MINGW_GXX(), CBuild::MINGW_GXXMT< hash >::MINGW_GXXMT(), CBuild::MINGW_GXXMT< hash >::MINGW_GXXMT(), and CBuild::SimpleToolchain< hash >::set_compiler().

◆ compiler_args

std::vector<std::string> CBuild::Toolchain::compiler_args
protected

◆ dependency_list

std::vector<CBuild::Dependency*> CBuild::Toolchain::dependency_list
protected

Dependencies.

Definition at line 142 of file Build.hpp.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ depends

std::vector<std::string> CBuild::Toolchain::depends
protected

◆ dummy

bool CBuild::Toolchain::dummy = false
protected

We do dummy compilation.

Definition at line 118 of file Build.hpp.

Referenced by CBuild::MetaToolchain::call().

◆ force

bool CBuild::Toolchain::force
protected

◆ gen_file_list_for_linking

bool CBuild::Toolchain::gen_file_list_for_linking = false
protected

◆ gen_out_name_without_base_path

bool CBuild::Toolchain::gen_out_name_without_base_path = false
protected

gen_out_name() dont prepend base path

Definition at line 126 of file Build.hpp.

◆ hasher

Hash* CBuild::Toolchain::hasher
protected

◆ id

std::string CBuild::Toolchain::id
protected

◆ link_args

std::vector<std::string> CBuild::Toolchain::link_args
protected

◆ linker

std::string CBuild::Toolchain::linker
protected

◆ name

std::string CBuild::Toolchain::name = ""
protected

◆ packer

std::string CBuild::Toolchain::packer
protected

ar command for packing static libraries

Definition at line 106 of file Build.hpp.

Referenced by CBuild::CLANG< hash >::CLANG(), CBuild::CLANG< hash >::CLANG(), CBuild::CLANGMT< hash >::CLANGMT(), CBuild::CLANGMT< hash >::CLANGMT(), CBuild::CLANGXX< hash >::CLANGXX(), CBuild::CLANGXX< hash >::CLANGXX(), CBuild::CLANGXXMT< hash >::CLANGXXMT(), CBuild::CLANGXXMT< hash >::CLANGXXMT(), CBuild::GCC< hash >::GCC(), CBuild::GCC< hash >::GCC(), CBuild::GCCMT< hash >::GCCMT(), CBuild::GCCMT< hash >::GCCMT(), CBuild::GXX< hash >::GXX(), CBuild::GXX< hash >::GXX(), CBuild::GXXMT< hash >::GXXMT(), CBuild::GXXMT< hash >::GXXMT(), CBuild::CLANGXX< hash >::link_pack(), CBuild::CLANGXXMT< hash >::link_pack(), CBuild::CLANG< hash >::link_pack(), CBuild::CLANGMT< hash >::link_pack(), CBuild::GXX< hash >::link_pack(), CBuild::GXXMT< hash >::link_pack(), CBuild::GCC< hash >::link_pack(), CBuild::GCCMT< hash >::link_pack(), CBuild::MINGW_GXX< hash >::link_pack(), CBuild::MINGW_GXXMT< hash >::link_pack(), CBuild::MINGW_GCC< hash >::link_pack(), CBuild::MINGW_GCCMT< hash >::link_pack(), CBuild::SimpleToolchain< hash >::link_pack(), CBuild::MINGW_GCC< hash >::MINGW_GCC(), CBuild::MINGW_GCC< hash >::MINGW_GCC(), CBuild::MINGW_GCCMT< hash >::MINGW_GCCMT(), CBuild::MINGW_GCCMT< hash >::MINGW_GCCMT(), CBuild::MINGW_GXX< hash >::MINGW_GXX(), CBuild::MINGW_GXX< hash >::MINGW_GXX(), CBuild::MINGW_GXXMT< hash >::MINGW_GXXMT(), CBuild::MINGW_GXXMT< hash >::MINGW_GXXMT(), and CBuild::SimpleToolchain< hash >::set_packer().

◆ pkg_config_include_entries

std::vector<std::string> CBuild::Toolchain::pkg_config_include_entries
protected

Libs that need to be searched in pkg-config.

Definition at line 134 of file Build.hpp.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ project_deps

std::vector<CBuild::Project_dependency> CBuild::Toolchain::project_deps
protected

Project dependencies.

Definition at line 114 of file Build.hpp.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ required

lib::map<std::string, CBuild::stage> CBuild::Toolchain::required
protected

Save task id with run stage sprecified for this task.

Definition at line 78 of file Build.hpp.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ stdargs_lock

bool CBuild::Toolchain::stdargs_lock = false
protected

Lock that specifies that stdargs() function need to do nothing.

Definition at line 157 of file Build.hpp.

◆ targets

std::vector<CBuild::Path> CBuild::Toolchain::targets
protected

Target files or folders.

Definition at line 86 of file Build.hpp.

Referenced by CBuild::ConfigToolchain::clone_config().

◆ version_major

int CBuild::Toolchain::version_major = -1
protected

Major version, can be necesary for shared libraries.

Definition at line 122 of file Build.hpp.

Referenced by CBuild::ConfigToolchain::clone_config(), and CBuild::ConfigToolchain::set_version_major().


The documentation for this class was generated from the following files: