diff options
author | Brad King <brad.king@kitware.com> | 2021-10-19 15:28:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-10-19 15:50:07 (GMT) |
commit | 71f15be957b1a4fc37edbfd70809c759e92227a2 (patch) | |
tree | ed1e0be02e4f8b4bc8c576494ee43166ab2bddb5 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 7fcc35c676b46fc30cb67425bfc72c7de040d6bf (diff) | |
download | CMake-71f15be957b1a4fc37edbfd70809c759e92227a2.zip CMake-71f15be957b1a4fc37edbfd70809c759e92227a2.tar.gz CMake-71f15be957b1a4fc37edbfd70809c759e92227a2.tar.bz2 |
VS: Fix compilation of single source with PCH in Unity Build
Sources that are part of a unity build are normally not compiled
individually. However, the VS IDE allows a single source to be
compiled. This can also be achieved on the command line:
msbuild my.vcxproj ... -t:ClCompile -p:SelectedFiles=<src>
where `<src>` is the path in the vcxproj `ClCompile` entry.
In a target with precompiled headers, the source needs PCH settings to
support individual compilation even if the normal unity build does not.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 1ea0461..b792c03 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2337,7 +2337,8 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) } } - if (si.Kind == cmGeneratorTarget::SourceKindObjectSource) { + if (si.Kind == cmGeneratorTarget::SourceKindObjectSource || + si.Kind == cmGeneratorTarget::SourceKindUnityBatched) { this->OutputSourceSpecificFlags(e2, si.Source); } if (si.Source->GetPropertyAsBool("SKIP_PRECOMPILE_HEADERS")) { |