@@ -107,54 +107,26 @@ public class LLBuildManifestBuilder {
107107 case . swift( let desc) :
108108 try self . createSwiftCompileCommand ( desc)
109109 case . clang( let desc) :
110- try self . createClangCompileCommand ( desc)
110+ if desc. buildParameters. prepareForIndexing == . off {
111+ try self . createClangCompileCommand ( desc)
112+ } else {
113+ // Hook up the clang module target when preparing
114+ try self . createClangPrepareCommand ( desc)
115+ }
111116 }
112117 }
113118 }
114119
115- try self . addTestDiscoveryGenerationCommand ( )
116- try self . addTestEntryPointGenerationCommand ( )
117-
118- // Create command for all products in the plan.
119- for description in self . plan. productMap {
120- try self . createProductCommand ( description)
121- }
122-
123- try LLBuildManifestWriter . write ( self . manifest, at: path, fileSystem: self . fileSystem)
124- return self . manifest
125- }
126-
127- package func generatePrepareManifest( at path: AbsolutePath ) throws -> LLBuildManifest {
128- self . swiftGetVersionFiles. removeAll ( )
129-
130- self . manifest. createTarget ( TargetKind . main. targetName)
131- self . manifest. createTarget ( TargetKind . test. targetName)
132- self . manifest. defaultTarget = TargetKind . main. targetName
133-
134- addPackageStructureCommand ( )
135-
136- for description in self . plan. targetMap {
137- switch description {
138- case . swift( let desc) :
139- try self . createSwiftCompileCommand ( desc)
140- case . clang( let desc) :
141- if desc. destination == . host {
142- // Need the clang modules for tools
143- try self . createClangCompileCommand ( desc)
144- } else {
145- // Hook up the clang module target
146- try self . createClangPrepareCommand ( desc)
147- }
148- }
120+ // Skip test discovery if preparing for indexing
121+ if self . plan. destinationBuildParameters. prepareForIndexing == . off {
122+ try self . addTestDiscoveryGenerationCommand ( )
123+ try self . addTestEntryPointGenerationCommand ( )
149124 }
150125
126+ // Create command for all products in the plan.
151127 for description in self . plan. productMap {
152- // Need to generate macro products
153- switch description. product. type {
154- case . macro, . plugin:
128+ if description. buildParameters. prepareForIndexing == . off {
155129 try self . createProductCommand ( description)
156- default :
157- break
158130 }
159131 }
160132
@@ -199,6 +171,9 @@ extension LLBuildManifestBuilder {
199171 // its source binary.
200172 var destinations = [ AbsolutePath: AbsolutePath] ( )
201173 for target in self . plan. targetMap. values {
174+ // skip if target is preparing for indexing
175+ guard target. buildParameters. prepareForIndexing == . off else { continue }
176+
202177 for binaryPath in target. libraryBinaryPaths {
203178 destinations [ target. buildParameters. destinationPath ( forBinaryAt: binaryPath) ] = binaryPath
204179 }
0 commit comments