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

#include <manual_hash.hpp>

Inheritance diagram for CBuild::CBuildHash:
CBuild::Hash

Public Member Functions

 CBuildHash (std::string target_id)
 
virtual lib::map< std::string, std::string > get_files_for_recompilation (std::vector< std::string > file_list, std::vector< std::string > objects_list) override
 Pass a list of source files and coresponding object files and get a map of source-object that need to be recompiled (check only hash and dependencie hash, not any arg canges)
 
virtual int compare_and_set_cargs (std::vector< std::string > cargs) override
 Compare compile args and update metadata.
 
virtual int compare_and_set_largs (std::vector< std::string > largs) override
 Compare link args and update metadata.
 
virtual int compare_and_set_commands (std::string compiler, std::string linker, std::string packer) override
 Compare shell commands used for compilation and update metadata.
 
virtual int compare_and_set_output_file (std::string out) override
 Compare output file name and update metadata.
 
virtual void set_target_meta (std::vector< std::string > cargs, std::vector< std::string > largs, std::string out, std::string compiler, std::string linker, std::string packer) override
 Set the target meta.
 
- Public Member Functions inherited from CBuild::Hash
 Hash (std::string target_id)
 

Protected Member Functions

std::string gen_out_file (std::string file)
 

Additional Inherited Members

- Protected Attributes inherited from CBuild::Hash
std::string target_id
 

Detailed Description

Definition at line 33 of file manual_hash.hpp.

Constructor & Destructor Documentation

◆ CBuildHash()

CBuild::CBuildHash::CBuildHash ( std::string target_id)
inline

Definition at line 55 of file manual_hash.hpp.

Member Function Documentation

◆ compare_and_set_cargs()

virtual int CBuild::CBuildHash::compare_and_set_cargs ( std::vector< std::string > cargs)
inlineoverridevirtual

Compare compile args and update metadata.

Parameters
cargs=> std::vector<std::string> -> Compile args
Returns
int -> 0 - all good, 1 - args didnt match, -1 - File didnt exist at all

Implements CBuild::Hash.

Definition at line 69 of file manual_hash.hpp.

References CBuild::target_metadata_file::cargs, CBuild::read_target_metadata(), CBuild::Hash::target_id, and CBuild::write_target_metadata().

◆ compare_and_set_commands()

virtual int CBuild::CBuildHash::compare_and_set_commands ( std::string compiler,
std::string linker,
std::string packer )
inlineoverridevirtual

Compare shell commands used for compilation and update metadata.

Parameters
compiler=> std::string -> Command used for compiling source files
linker=> std::string -> Command used for linking objects
packer=> std::string -> Command used for packing static libs
Returns
int -> 0 - all good, 1 - args didnt match, -1 - File didnt exist at all

Implements CBuild::Hash.

Definition at line 93 of file manual_hash.hpp.

References CBuild::target_metadata_file::compiler, CBuild::target_metadata_file::linker, CBuild::target_metadata_file::packer, CBuild::read_target_metadata(), CBuild::Hash::target_id, and CBuild::write_target_metadata().

◆ compare_and_set_largs()

virtual int CBuild::CBuildHash::compare_and_set_largs ( std::vector< std::string > largs)
inlineoverridevirtual

Compare link args and update metadata.

Parameters
cargs=> std::vector<std::string> -> Compile args
Returns
int -> 0 - all good, 1 - args didnt match, -1 - File didnt exist at all

Implements CBuild::Hash.

Definition at line 81 of file manual_hash.hpp.

References CBuild::target_metadata_file::largs, CBuild::read_target_metadata(), CBuild::Hash::target_id, and CBuild::write_target_metadata().

◆ compare_and_set_output_file()

virtual int CBuild::CBuildHash::compare_and_set_output_file ( std::string out)
inlineoverridevirtual

Compare output file name and update metadata.

Parameters
out=> std::string -> Output name
Returns
int -> 0 - all good, 1 - args didnt match, -1 - File didnt exist at all

Implements CBuild::Hash.

Definition at line 108 of file manual_hash.hpp.

References CBuild::target_metadata_file::out, CBuild::read_target_metadata(), CBuild::Hash::target_id, and CBuild::write_target_metadata().

◆ gen_out_file()

std::string CBuild::CBuildHash::gen_out_file ( std::string file)
inlineprotected

Definition at line 35 of file manual_hash.hpp.

References CBUILD_BUILD_CACHE_DIR, CBUILD_BUILD_DIR, and CBuild::Hash::target_id.

◆ get_files_for_recompilation()

virtual lib::map< std::string, std::string > CBuild::CBuildHash::get_files_for_recompilation ( std::vector< std::string > file_list,
std::vector< std::string > objects_list )
inlineoverridevirtual

Pass a list of source files and coresponding object files and get a map of source-object that need to be recompiled (check only hash and dependencie hash, not any arg canges)

Parameters
file_list=> std::vector<std::string> -> List of source files
objects_list=> std::vector<std::string> -> List of object files
Returns
lib::map<std::string, std::string> -> Map of source->object, that need to be recompiled

Implements CBuild::Hash.

Definition at line 57 of file manual_hash.hpp.

References CBuild::get_files(), lib::map< _K, _D >::push_back(), and CBuild::Hash::target_id.

◆ set_target_meta()

virtual void CBuild::CBuildHash::set_target_meta ( std::vector< std::string > cargs,
std::vector< std::string > largs,
std::string out,
std::string compiler,
std::string linker,
std::string packer )
inlineoverridevirtual

Set the target meta.

Parameters
cargs=> std::vector<std::string> -> Compile args
largs=> std::vector<std::string> -> Link args
out=> std::string -> Output binary name
compiler=> std::string -> Command used for compiling source files
linker=> std::string -> Command used for linking objects
packer=> std::string -> Command used for packing static libs

Implements CBuild::Hash.

Definition at line 120 of file manual_hash.hpp.

References CBuild::target_metadata_file::cargs, CBuild::target_metadata_file::compiler, CBuild::target_metadata_file::largs, CBuild::target_metadata_file::linker, CBuild::target_metadata_file::out, CBuild::target_metadata_file::packer, CBuild::Hash::target_id, and CBuild::write_target_metadata().


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