33#ifndef __CBUILD_DEP_HPP__
34#define __CBUILD_DEP_HPP__
51 this->target_id +
"/" + this->target_id +
55 meta.
out.substr(meta.
out.find_last_of(
"/") + 1));
64 this->target_id +
"/" + this->target_id +
68 meta.
out.substr(meta.
out.find_last_of(
"/") + 4,
69 (meta.
out.length() - (meta.
out.find_last_of(
"/") + 4) -
70 (meta.
out.length() - meta.
out.find_last_of(
".")))));
76 this->target_id +
"/" + this->target_id +
79 std::string ccmd = meta.
compiler +
" ";
80 for (
auto carg : meta.
cargs) {
84 std::string lcmd = meta.
linker +
" ";
85 for (
auto larg : meta.
largs) {
95 std::string object_list =
"";
103 for (
auto file : files) {
106 if (smeta.
object != std::string(
"header")) {
110 smeta.
object.substr(smeta.
object.find_last_of(
"/") + 1);
111 this->
compile(ccmd +
" -c " + this->path +
"/" + smeta.
source +
" -o " +
114 smeta.
object.substr(smeta.
object.find_last_of(
"/") + 1));
119 meta.
out.substr(meta.
out.find_last_of(
"/")));
122 meta.
out.substr(meta.
out.find_last_of(
"/") + 1),
124 meta.
out.substr(meta.
out.find_last_of(
"/") + 1));
126 this->headers_dir.substr(this->headers_dir.find_last_of(
"/") + 1)},
129 "/extproject_" + this->target_id);
#define CBUILD_BUILD_OUT_DIR
Build out in build/toolchain.
#define CBUILD_PROJECT_DEPS_DIR
For other included project, in cache dir.
#define CBUILD_BUILD_CACHE_DIR
Object cache in build/toolchain.
#define CBUILD_METADATA_FOLDER
Metadata folder for targets.
#define CBUILD_METADATA_FILE_EXTENSION
Extension for CBuild metadata files.
#define CBUILD_CACHE_DIR
Cache directory of CBuild.
#define CBUILD_PROJECT_DEPS_HEADERS
For other included project, in cache dir.
#define CBUILD_BUILD_DIR
Build directory of CBuild.
Build metadata config file.
std::string cargs() override
CBuildDependency(std::string path, std::string target_id, std::string headers_dir)
bool need_prepare() override
std::string largs() override
void compile(std::string str)
Some external dependency. Base class.
bool exists(std::string path)
Check if file exists.
bool create(std::vector< std::string > paths, CBuild::fs::type what)
Create element.
bool copy(std::string start, std::string end)
Copy files or directories.
@ DIR
Alias for DIRECTORY.
std::vector< std::string > dir(std::string path, std::string search)
Search files using provided regex.
Filebuffer for CBuild ecosystem.
void print(std::string msg, color fg=CBuild::WHITE)
Print colored text to STDOUT.
int read_file_metadata_direct(std::string target_id, std::string file, CBuild::source_metadata_file *metadata)
Load metadata for source 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.
int system(std::string cmd)
Call stdlib system() and print cmd to shell.
void print_full(std::string msg, color fg=CBuild::WHITE)
Print colored text to STDOUT if verbose flag is set.
Custom print that support color codes.