@@ -206,36 +206,46 @@ List<string> skipFiles
206206 string projectBffFile = Bff . GetBffFileName ( projectPath , firstConf . BffFileName ) ; // TODO: bff file name could be different per conf, hence we would generate more than one file
207207 string fastBuildClrSupport = Util . IsDotNet ( firstConf ) ? "/clr" : FileGeneratorUtilities . RemoveLineTag ;
208208 List < Vcxproj . ProjectFile > filesInNonDefaultSection ;
209- var confSourceFiles = GetGeneratedFiles ( context , configurations , out filesInNonDefaultSection ) ;
209+ Dictionary < Project . Configuration , Dictionary < Tuple < bool , bool , bool , bool , bool , bool , Options . Vc . Compiler . Exceptions , Tuple < bool > > , List < Vcxproj . ProjectFile > > > confSourceFiles ;
210+ using ( builder . CreateProfilingScope ( "BffGenerator.Generate:GetGeneratedFiles" ) )
211+ {
212+ confSourceFiles = GetGeneratedFiles ( context , configurations , out filesInNonDefaultSection ) ;
213+ }
210214
211215 // Generate all configuration options onces...
212216 var options = new Dictionary < Project . Configuration , Options . ExplicitOptions > ( ) ;
213217 var cmdLineOptions = new Dictionary < Project . Configuration , ProjectOptionsGenerator . VcxprojCmdLineOptions > ( ) ;
214218 var additionalDependenciesPerConf = new Dictionary < Project . Configuration , OrderableStrings > ( ) ;
215- var projectOptionsGen = new ProjectOptionsGenerator ( ) ;
216- foreach ( Project . Configuration conf in configurations )
219+ ProjectOptionsGenerator projectOptionsGen ;
220+ using ( builder . CreateProfilingScope ( "BffGenerator.Generate:ProjectOptionsGenerator()" ) )
221+ {
222+ projectOptionsGen = new ProjectOptionsGenerator ( ) ;
223+ }
224+ using ( builder . CreateProfilingScope ( "BffGenerator.Generate:confs1" ) )
217225 {
218- context . Options = new Options . ExplicitOptions ( ) ;
219- context . CommandLineOptions = new ProjectOptionsGenerator . VcxprojCmdLineOptions ( ) ;
220- context . Configuration = conf ;
226+ foreach ( Project . Configuration conf in configurations )
227+ {
228+ context . Options = new Options . ExplicitOptions ( ) ;
229+ context . CommandLineOptions = new ProjectOptionsGenerator . VcxprojCmdLineOptions ( ) ;
230+ context . Configuration = conf ;
221231
222- GenerateBffOptions ( projectOptionsGen , context , additionalDependenciesPerConf ) ;
232+ GenerateBffOptions ( projectOptionsGen , context , additionalDependenciesPerConf ) ;
223233
224- options . Add ( conf , context . Options ) ;
225- cmdLineOptions . Add ( conf , ( ProjectOptionsGenerator . VcxprojCmdLineOptions ) context . CommandLineOptions ) ;
234+ options . Add ( conf , context . Options ) ;
235+ cmdLineOptions . Add ( conf , ( ProjectOptionsGenerator . VcxprojCmdLineOptions ) context . CommandLineOptions ) ;
226236
227- // Validation of unsupported cases
228- if ( conf . EventPreLink . Count > 0 )
229- throw new Error ( "Sharpmake-FastBuild : Pre-Link Events not yet supported." ) ;
230- if ( context . Options [ "IgnoreImportLibrary" ] == "true" )
231- throw new Error ( "Sharpmake-FastBuild : IgnoreImportLibrary not yet supported." ) ;
237+ // Validation of unsupported cases
238+ if ( conf . EventPreLink . Count > 0 )
239+ throw new Error ( "Sharpmake-FastBuild : Pre-Link Events not yet supported." ) ;
240+ if ( context . Options [ "IgnoreImportLibrary" ] == "true" )
241+ throw new Error ( "Sharpmake-FastBuild : IgnoreImportLibrary not yet supported." ) ;
232242
233- if ( conf . Output != Project . Configuration . OutputType . None && conf . FastBuildBlobbed )
234- {
235- ConfigureUnities ( context , confSourceFiles ) ;
243+ if ( conf . Output != Project . Configuration . OutputType . None && conf . FastBuildBlobbed )
244+ {
245+ ConfigureUnities ( context , confSourceFiles ) ;
246+ }
236247 }
237248 }
238-
239249 ResolveUnities ( project , projectPath ) ;
240250
241251 // Start writing Bff
@@ -1453,10 +1463,11 @@ private static void FillLinkerOptions(BffGenerationContext context)
14531463 private static Strings CollectNatvisFiles ( BffGenerationContext context )
14541464 {
14551465 Project . Configuration projectConfig = context . Configuration ;
1466+
1467+ var natvisFiles = new Strings ( projectConfig . Project . NatvisFiles ) ;
14561468 if ( projectConfig . Output == Project . Configuration . OutputType . Dll || projectConfig . Output == Project . Configuration . OutputType . Exe )
14571469 {
1458- Strings natvisFiles = new Strings ( projectConfig . Project . NatvisFiles ) ;
1459- HashSet < Project > visitedProjects = new HashSet < Project > ( ) ;
1470+ var visitedProjects = new HashSet < Project > ( ) ;
14601471 foreach ( Project . Configuration resolvedDepConfig in projectConfig . ResolvedDependencies )
14611472 {
14621473 if ( resolvedDepConfig . Output != Project . Configuration . OutputType . Dll && resolvedDepConfig . Output != Project . Configuration . OutputType . Exe )
@@ -1471,13 +1482,8 @@ private static Strings CollectNatvisFiles(BffGenerationContext context)
14711482 }
14721483 }
14731484 }
1474-
1475- return natvisFiles ;
1476- }
1477- else
1478- {
1479- return projectConfig . Project . NatvisFiles ;
14801485 }
1486+ return natvisFiles ;
14811487 }
14821488
14831489 private static void FillEmbeddedNatvisOptions ( BffGenerationContext context )
0 commit comments