Configurations mixed up in Visual Studio projects created by latest Projucer

Dear JUCE team!

I recognized a very strange behaviour when trying to build our VS2022 projects since updating to the latest JUCE version 8.0.6.
In our .jucer files, we normally have one VS2022 exporter with four configurations:

  • Debug Win32
  • Release Win32
  • Debug x64
  • Release x64

Up to JUCE 8.0.4 this worked well. But with the latest Projucer, the created .vcproj files contain 8 instead of 4 configurations!
In Visual Studio, only 4 of them can be selected using the Platform (Win32 / x64) and the Configuration (Debug / Release) switches. The others are unreachable.
The problem is, that the selectable configurations are not the ones I need, as some of them are a mixture of the confgurations defined in the .jucer file.
For example the Win32 configuration that can be selected contains a binary name that is only defined in the x64 configurations.

I could track down the issue this commit:
https://github.com/juce-framework/JUCE/commit/ac0ebe5797a3dcc51d6c04374aa562690fc802f1

In file jucer_ProjectExport_MSVC.h, several loops have been added that look like this:

for (const auto& arch : allArchitectures)
{
 ...
}

All of them are used inside another loop that runs over ConstConfigIterator.

Because of these nested loops, for each configuration that is defined in the .jucer file, the Projucer will create multiple configurations in the .vcproj file. One for each platform that is used in any configuration in the project.
I do not undestand these loops. Each configuration in the .jucer file is defined for a dedicated platform, so in my opinion it makes no sense to loop over all platforms here.

Please let me know, if this is intentional and how to define the Projucer project in a way that I can have configurations that can use different settings for different platforms (e.g. different binary names).

Edit:
In my first post I had not been aware that it is now possible to select multiple architectures at once in Projucer. Now I understand the intention of those loops.
But I still think that these should only loop over the selected architectures in each configuration, instead of looping over all architectures used in any configuration.

So I would propose that in jucer_ProjectExport_MSVC.h all occurences of

for (const auto& arch : allArchitectures)
{
 ...
}

should be replaced by

const auto configArchs = config.getArchitectures();
for (const auto& arch : configArchs)
{
...
}

This is intentional. Visual Studio will create missing platform targets when the selected architectures are not symmetric (ie Release only Arm build). These new platform targets can fail to build in some scenarios.

We create these targets with the sole intention of marking them not to be built to prevent build failures later on.