@@ -410,6 +410,13 @@ static bool buildModuleFromInterface(CompilerInstance &Instance) {
410
410
bool IgnoreAdjacentModules = Instance.hasASTContext () &&
411
411
Instance.getASTContext ().IgnoreAdjacentModules ;
412
412
413
+ // When building explicit module dependencies, they are
414
+ // discovered by dependency scanner and the swiftmodule is already rebuilt
415
+ // ignoring candidate module. There is no need to serialized dependencies for
416
+ // validation purpose because the build system (swift-driver) is then
417
+ // responsible for checking whether inputs are up-to-date.
418
+ bool ShouldSerializeDeps = !FEOpts.ExplicitInterfaceBuild ;
419
+
413
420
// If an explicit interface build was requested, bypass the creation of a new
414
421
// sub-instance from the interface which will build it in a separate thread,
415
422
// and isntead directly use the current \c Instance for compilation.
@@ -422,8 +429,7 @@ static bool buildModuleFromInterface(CompilerInstance &Instance) {
422
429
return ModuleInterfaceLoader::buildExplicitSwiftModuleFromSwiftInterface (
423
430
Instance, Invocation.getClangModuleCachePath (),
424
431
FEOpts.BackupModuleInterfaceDir , PrebuiltCachePath, ABIPath, InputPath,
425
- Invocation.getOutputFilename (),
426
- /* shouldSerializeDeps */ true ,
432
+ Invocation.getOutputFilename (), ShouldSerializeDeps,
427
433
Invocation.getSearchPathOptions ().CandidateCompiledModules );
428
434
429
435
return ModuleInterfaceLoader::buildSwiftModuleFromSwiftInterface (
0 commit comments