CBuild
C++ build system with scripts written in c++
Loading...
Searching...
No Matches
build_data.hpp
Go to the documentation of this file.
1
21#ifndef __BUILD_DATA_HPP__
22#define __BUILD_DATA_HPP__
23// C++ libs
24#include "cstdint"
25#include "string"
26#include "vector"
27// Code
28namespace CBuild {
43 std::string source;
47 std::string object;
51 std::vector<std::string> deps;
55 uint64_t hash;
56};
75 std::string out;
79 std::string compiler;
83 std::string linker;
87 std::string packer;
91 std::vector<std::string> cargs;
95 std::vector<std::string> largs;
96};
114int read_file_metadata(std::string target_id, std::string src_file,
124int read_file_metadata_direct(std::string target_id, std::string file,
133int read_target_metadata(std::string target_id, CBuild::target_metadata_file* metadata);
141int read_target_metadata_direct(std::string path, CBuild::target_metadata_file* metadata);
151int read_file_hash(std::string target_id, std::string file, uint64_t* hash);
160int write_file_metadata(std::string target_id, std::string src_file,
169int write_target_metadata(std::string target_id, CBuild::target_metadata_file* metadata);
179int write_file_hash(std::string target_id, std::string file, uint64_t* hash);
187std::string get_file_metadata_path(std::string target_id, std::string file);
194std::string get_target_metadata_path(std::string target_id);
195} // namespace CBuild
196#endif // __BUILD_DATA_HPP__
Filebuffer for CBuild ecosystem.
Definition Build.hpp:34
uint64_t hash(std::string str)
FNV-1a hashing function for std::string.
Definition hash.cpp:218
int write_file_hash(std::string target_id, std::string file, uint64_t *hash)
int read_file_metadata_direct(std::string target_id, std::string file, CBuild::source_metadata_file *metadata)
Load metadata for source file.
int write_file_metadata(std::string target_id, std::string src_file, CBuild::source_metadata_file *metadata)
Write a metadata for a file to a file.
int read_file_metadata(std::string target_id, std::string src_file, CBuild::source_metadata_file *metadata)
Load metadata for source file.
int read_target_metadata(std::string target_id, CBuild::target_metadata_file *metadata)
Load metadata for a full target.
std::string get_target_metadata_path(std::string target_id)
Get the path to a target metadata file.
int read_target_metadata_direct(std::string path, CBuild::target_metadata_file *metadata)
Load metadata for a full target using path to metdata file.
std::string get_file_metadata_path(std::string target_id, std::string file)
Get the path to a file metadata file.
int write_target_metadata(std::string target_id, CBuild::target_metadata_file *metadata)
Write a metadata for a full target.
int read_file_hash(std::string target_id, std::string file, uint64_t *hash)
Get a file hash (internally uses read_file_metadata, so no performance benefits, but easiier to use i...
Metadata for source files (.cpp/.c/etc) Structure of file:
std::string object
Object file name.
std::string source
Source file path (relative to CBuild.run)
std::vector< std::string > deps
On what files this file depends.
uint64_t hash
Hash of this file.
Metadata for a full toolchain Structure of file:
std::string out
Path to output binary (relative to CBuild.run)
std::string packer
Command used to pack this target to a static library (what shell command was used)
std::vector< std::string > largs
Link args.
std::vector< std::string > cargs
Compile args.
std::string linker
Command used to link this target (what shell command was used)
std::string compiler
Command used to compile this target (what shell command was used)