Skip to content

Commit

Permalink
Fix xcode project generation for fastbuild targets when a project is …
Browse files Browse the repository at this point in the history
…only used by some target but not the first one

Was previously crashing in BuildArgumentsStringByCommandLineOptions when trying to access FastBuildMasterBffList.
  • Loading branch information
jspelletier committed Dec 12, 2024
1 parent d4ec68e commit 457d133
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sharpmake.Generators/Apple/XCodeProj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,12 @@ private void PrepareSections(XCodeGenerationContext context, List<Project.Config
}

var firstConf = targetConfigurations.First();
// Adjust fastbuild target
if (firstConf.IsFastBuild)
{
// Handle cases where a configuration is using fastbuild but not all configurations are using it(and the first one is not using it)
firstConf = targetConfigurations.FirstOrDefault(conf => conf.FastBuildMasterBffList.Any(), targetConfigurations[0]);
}

bool canIncludeSourceFiles = !firstConf.IsFastBuild || firstConf.Output != Project.Configuration.OutputType.AppleApp || !firstConf.XcodeUseNativeProjectForFastBuildApp;
if (canIncludeSourceFiles)
Expand Down

0 comments on commit 457d133

Please sign in to comment.