@@ -30,7 +30,17 @@ import Dispatch
30
30
/// An abstraction of a cache and query-engine of inter-module dependencies
31
31
public class InterModuleDependencyOracle {
32
32
/// Allow external clients to instantiate the oracle
33
- public init ( ) { }
33
+ /// - Parameter scannerRequiresPlaceholderModules: Configures this driver's/oracle's scanner invocations to
34
+ /// specify external module dependencies to be treated as placeholders. This is required in contexts
35
+ /// where the dependency scanning action is invoked for a module which depends on another module
36
+ /// that is part of the same build but has not yet been built. Treating it as a placeholder
37
+ /// will allow the scanning action to not fail when it fails to detect this dependency on
38
+ /// the filesystem. For example, SwiftPM plans all targets belonging to a package before *any* of them
39
+ /// are built. So this setting is meant to be used there. In contexts where planning a module
40
+ /// necessarily means all of its dependencies have already been built this is not necessary.
41
+ public init ( scannerRequiresPlaceholderModules: Bool = false ) {
42
+ self . scannerRequiresPlaceholderModules = scannerRequiresPlaceholderModules
43
+ }
34
44
35
45
@_spi ( Testing) public func getDependencies( workingDirectory: AbsolutePath ,
36
46
moduleAliases: [ String : String ] ? = nil ,
@@ -145,5 +155,7 @@ public class InterModuleDependencyOracle {
145
155
146
156
/// A reference to an instance of the compiler's libSwiftScan shared library
147
157
private var swiftScanLibInstance : SwiftScan ? = nil
158
+
159
+ internal let scannerRequiresPlaceholderModules : Bool
148
160
}
149
161
0 commit comments