summaryrefslogtreecommitdiff
path: root/src/buildtool/storage/target_cache_entry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/storage/target_cache_entry.cpp')
-rw-r--r--src/buildtool/storage/target_cache_entry.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/buildtool/storage/target_cache_entry.cpp b/src/buildtool/storage/target_cache_entry.cpp
index 002b3465..2f245624 100644
--- a/src/buildtool/storage/target_cache_entry.cpp
+++ b/src/buildtool/storage/target_cache_entry.cpp
@@ -17,6 +17,8 @@
#include <algorithm>
#include <exception>
#include <iterator>
+#include <string>
+#include <vector>
#include "src/buildtool/logging/log_level.hpp"
#include "src/buildtool/logging/logger.hpp"
@@ -29,10 +31,18 @@ auto TargetCacheEntry::FromTarget(
auto result = TargetResult{.artifact_stage = target->Artifacts(),
.provides = target->Provides(),
.runfiles = target->RunFiles()};
- if (auto desc = result.ReplaceNonKnownAndToJson(replacements)) {
- return TargetCacheEntry{*desc};
+ auto desc = result.ReplaceNonKnownAndToJson(replacements);
+ if (not desc) {
+ return std::nullopt;
}
- return std::nullopt;
+ std::vector<std::string> implied{};
+ for (auto const& x : target->ImpliedExport()) {
+ implied.emplace_back(x);
+ }
+ if (not implied.empty()) {
+ (*desc)["implied export targets"] = implied;
+ }
+ return TargetCacheEntry{*desc};
}
auto TargetCacheEntry::FromJson(nlohmann::json desc) noexcept