Skip to content

Commit

Permalink
Fix dependency program arch.
Browse files Browse the repository at this point in the history
  • Loading branch information
egorpugin committed Sep 22, 2023
1 parent 55d4491 commit 185d8bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sw/driver/command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ CommandBuilder &CommandBuilder::operator<<(const ::sw::cmd::tag_env &t)
CommandBuilder &CommandBuilder::operator<<(const ::sw::cmd::tag_prog_dep &t)
{
std::dynamic_pointer_cast<::sw::driver::Command>(c)->setProgram(t.d);
getTarget().addDummyDependency(t.d);
getTarget().addProgDependency(t.d);
return *this;
}

Expand Down
12 changes: 12 additions & 0 deletions src/sw/driver/target/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,18 @@ DependencyPtr Target::addDummyDependency(const DependencyPtr &t)
return t;
}

DependencyPtr Target::addProgDependency(const DependencyPtr &t)
{
DummyDependencies.push_back(t);

auto hs = getHostSettings();
auto &ds = DummyDependencies.back()->settings;
ds.mergeMissing(hs);
ds["os"] = hs["os"];
ds["native"] = hs["native"];
return t;
}

DependencyPtr Target::addDummyDependency(const Target &t)
{
return addDummyDependency(std::make_shared<Dependency>(t));
Expand Down
1 change: 1 addition & 0 deletions src/sw/driver/target/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ struct SW_DRIVER_CPP_API Target : ITarget, TargetBase, ProgramStorage,

DependencyPtr addDummyDependency(const Target &);
DependencyPtr addDummyDependency(const DependencyPtr &);
DependencyPtr addProgDependency(const DependencyPtr &);
void addSourceDependency(const Target &);
void addSourceDependency(const DependencyPtr &);

Expand Down

0 comments on commit 185d8bf

Please sign in to comment.