Can’t reproduce this with JUCE examples since they are small projects. However, I can reproduce it with larger projects. In the shared code output, I see that my projects generate a library of approximately 2GB
We are also seeing this having moved from JUCE 8.0.5 to 8.0.7. I can see that a sharedcode lib on windows built against 8.0.5 was 2.3 Gb, whereas one built against 8.0.7 is now 3.8Gb.
Any ideas on possible causes for this >50% increase in lib size?
Following up on this, we’ve determined that this could be down to changes to debug information generation. By default, if you have a project set to not generate debug information at all, it still adds a line for ‘DebugInformationFormat=OldStyle’, whereas before 8.0.7 that setting was ommitted entirely if not generating debug information for a configuration.
We had a go trying different settings and found that for our failing project, using ‘ProgramDatabase’ brought the size down enough to complete compilation, and so did removing the DebugInformationFormat line entirely for configs that shouldn’t have debug information. We’ve made the latter change and can now continue.
Anecdotally, using ‘DebugInformationFormat=None’ also seemed to tip the size over the limit for us, which seemed odd.
We’ve now pushed a patch that changes the default debug-info format to “None” for configurations that are non-debug and without debug info force-enabled:
This should switch off the generation of unused debug info, reducing object file sizes. Please let us know if you’re still seeing problems after rebuilding Projucer against the newest develop branch and resaving your projects.
The issue still persists for me, even after this commit (re-build Projucer and re-saved project).
I also tested the AudioPluginDemo with Force Generation of Debug Symbols set to Disabled. On Windows, the resulting AudioPluginDemo.lib for the shared code it’s 228 MB.
Maybe this is a bit more complex than I originally thought. There seems to be some interaction with the link-time code-generation (LTCG/LTO) flag, too.
I’m seeing the following here for a standard Release config with the following settings changed. I’m guessing I didn’t notice this previously because I was mostly testing in a Debug config without LTCG enabled.
LTO | Debug opt | Size of AudioPluginDemo.lib / KB | pdb size / KB
off | None | 37 816 | -
off | Z7 | 123 951 | -
off | Zi | 77 700 | 33 372
on | None | 235 128 | -
on | Z7 | 235 227 | -
on | Zi | 178 283 | 33 372
When LTCG is enabled, the None and Z7 configurations both seem to result in .lib files of approximately the same size. The 8.0.5 behaviour was to omit the debug info flag entirely, which MSVC would interpret as the default, Zi. So, if you need LTCG, then I’d suggest leaving debug info enabled with the format set to Zi. Unfortunately, the Zi flag can cause issues with other tools, like sccache, which is why we changed this behaviour. It doesn’t seem like there’s a good default that covers all use-cases: leaving the debug info format as “None” counter-intuitively leads to large file sizes, but setting it to Zi will break third-party tools.