mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Macro] Add a new macro loading option that do not involve searching
Add flag `-load-resolved-plugin` to load macro plugin, which provides a pre-resolved entry into PluginLoader so the plugins can be loaded based on module name without searching the file system. The option is mainly intended to be used by explicitly module build and the flag is supplied by dependency scanner.
This commit is contained in:
@@ -1753,6 +1753,15 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
|
||||
ArgSaver.save(val.SearchPath + "#" + val.ServerPath));
|
||||
break;
|
||||
}
|
||||
case PluginSearchOption::Kind::ResolvedPluginConfig: {
|
||||
auto &val = entry.get<PluginSearchOption::ResolvedPluginConfig>();
|
||||
for (auto &moduleName : val.ModuleNames) {
|
||||
GenericArgs.push_back("-load-plugin-executable");
|
||||
GenericArgs.push_back(ArgSaver.save(
|
||||
val.LibraryPath + "#" + val.ExecutablePath + "#" + moduleName));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user