VS: Fix pre-VS15.8 unity build exclusion of per-config sources

In a unity build, the original source files need to be excluded from
the build.  Prior to VS 15.8, this is done via `ExcludeFromBuild`,
which is the same mechanism used to implement per-config sources.
Fix a conflict in the implementation of the two features so that
unity-batched sources are excluded from all configurations rather
than just those in which they would otherwise have been included.
This commit is contained in:
Brad King
2021-11-11 07:07:02 -05:00
parent 53990059da
commit ea289314ef

View File

@@ -2351,7 +2351,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
// Visual Studio versions prior to 2017 15.8 do not know about unity // Visual Studio versions prior to 2017 15.8 do not know about unity
// builds, thus we exclude the files already part of unity sources. // builds, thus we exclude the files already part of unity sources.
if (!si.Source->GetPropertyAsBool("SKIP_UNITY_BUILD_INCLUSION")) { if (!si.Source->GetPropertyAsBool("SKIP_UNITY_BUILD_INCLUSION")) {
exclude_configs = si.Configs; exclude_configs = all_configs;
} }
} }
} }