added specfic git commit or branch dependency
This commit is contained in:
parent
af7eb61c3d
commit
1bfc07db4b
4 changed files with 24 additions and 4 deletions
|
|
@ -112,7 +112,17 @@ void Project::Build(Configuration config, fs::path outputDir, fs::path binDir) c
|
|||
|
||||
for(std::int_fast32_t i = 0; i < depThreads.size(); i++) {
|
||||
if(config.dependencies[i].path.ends_with(".git")) {
|
||||
system(std::format("cd {} && git clone {}", config.buildDir, config.dependencies[i].path).c_str());
|
||||
std::string branch;
|
||||
if(!config.dependencies[i].branch.empty()) {
|
||||
fs::path name = fs::path(config.dependencies[i].path).filename();
|
||||
name.replace_extension();
|
||||
branch = std::format(" && cd {} && git switch {}", name.generic_string(), config.dependencies[i].branch);
|
||||
} else if(!config.dependencies[i].commit.empty()){
|
||||
fs::path name = fs::path(config.dependencies[i].path).filename();
|
||||
name.replace_extension();
|
||||
branch = std::format(" && cd {} && git checkout {}", name.generic_string(), config.dependencies[i].commit);
|
||||
}
|
||||
system(std::format("cd {} && git clone {}{}", config.buildDir, config.dependencies[i].path, branch).c_str());
|
||||
config.dependencies[i].path = fs::path(config.dependencies[i].path).filename().replace_extension();
|
||||
Project project = Project::LoadFromJSON(fs::path(config.buildDir)/config.dependencies[i].path/"project.json");
|
||||
libs+=std::format(" -l{}", project.name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue