fileapi: Compute codemodel compile groups without target-wide settings

Previously we computed the entire description of each source file
including all target-wide settings, and then computed compile groups
using those complete descriptions.  This is inefficient when target-wide
settings are large because they are included in comparisons even though
they are the same for every source.  Instead compute source groups using
only the source-specific settings, and then merge the target-wide
settings into place only once per unique compile group.

This is a slight behavior change in the case that a source-specific
compile definition duplicates a target-wide definition.  Previously that
source would still be grouped with other sources which do not have the
definition because they would all get it from the target.  Now that
source will be in its own compile group even though it ultimately
compiles with the same settings as another group.  This is acceptable
because the source is specified by the project with source-specific
settings already.

Fixes: #19520
1 file changed