@@ -67,6 +67,11 @@ int main(int Argc, char **Argv) {
67
67
cl::list<std::string> Objects (cl::Positional, cl::desc (" <object>..." ));
68
68
cl::opt<std::string> CASPath (" cas" , cl::desc (" Path to CAS on disk." ),
69
69
cl::value_desc (" path" ));
70
+ cl::opt<std::string> CASPluginPath (" fcas-plugin-path" ,
71
+ cl::desc (" Path to plugin CAS library" ),
72
+ cl::value_desc (" path" ));
73
+ cl::list<std::string> CASPluginOpts (" fcas-plugin-option" ,
74
+ cl::desc (" Plugin CAS Options" ));
70
75
cl::opt<std::string> UpstreamCASPath (
71
76
" upstream-cas" , cl::desc (" Path to another CAS." ), cl::value_desc (" path" ));
72
77
cl::opt<std::string> DataPath (" data" ,
@@ -133,11 +138,21 @@ int main(int Argc, char **Argv) {
133
138
createStringError (inconvertibleErrorCode (), " missing --cas=<path>" ));
134
139
135
140
std::shared_ptr<ObjectStore> CAS;
136
- std::unique_ptr <ActionCache> AC;
141
+ std::shared_ptr <ActionCache> AC;
137
142
std::optional<StringRef> CASFilePath;
138
143
if (sys::path::is_absolute (CASPath)) {
139
144
CASFilePath = CASPath;
140
- std::tie (CAS, AC) = ExitOnErr (createOnDiskUnifiedCASDatabases (CASPath));
145
+ if (!CASPluginPath.empty ()) {
146
+ SmallVector<std::pair<std::string, std::string>> PluginOptions;
147
+ for (const auto &PluginOpt : CASPluginOpts) {
148
+ auto [Name, Val] = StringRef (PluginOpt).split (' =' );
149
+ PluginOptions.push_back ({std::string (Name), std::string (Val)});
150
+ }
151
+ std::tie (CAS, AC) = ExitOnErr (
152
+ createPluginCASDatabases (CASPluginPath, CASPath, PluginOptions));
153
+ } else {
154
+ std::tie (CAS, AC) = ExitOnErr (createOnDiskUnifiedCASDatabases (CASPath));
155
+ }
141
156
} else {
142
157
CAS = ExitOnErr (createCASFromIdentifier (CASPath));
143
158
}
0 commit comments