mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
DependenciesScanner: include -sdk in Swift module building command
Swift module building commands need -sdk because dependencies sometimes use sdk-relative paths (prebuilt modules for example). Without -sdk, the command will not be able to local these dependencies, leading to unnecessary rebuilding from textual interfaces. rdar://81177968
This commit is contained in:
@@ -1290,6 +1290,13 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
|
||||
genericSubInvocation.setImportSearchPaths(SearchPathOpts.ImportSearchPaths);
|
||||
genericSubInvocation.setFrameworkSearchPaths(SearchPathOpts.FrameworkSearchPaths);
|
||||
if (!SearchPathOpts.SDKPath.empty()) {
|
||||
// Add -sdk arguments to the module building commands.
|
||||
// Module building commands need this because dependencies sometimes use
|
||||
// sdk-relative paths (prebuilt modules for example). Without -sdk, the command
|
||||
// will not be able to local these dependencies, leading to unnecessary
|
||||
// building from textual interfaces.
|
||||
GenericArgs.push_back("-sdk");
|
||||
GenericArgs.push_back(ArgSaver.save(SearchPathOpts.SDKPath));
|
||||
genericSubInvocation.setSDKPath(SearchPathOpts.SDKPath);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user