mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 21:00:17 -06:00
Unity: Generic source file handling for all generators
This commit is contained in:
@@ -2519,12 +2519,7 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target)
|
||||
for (; begin != end; ++begin) {
|
||||
cmSourceFile* sf = filtered_sources[begin];
|
||||
|
||||
// Only in Visual Studio generator we keep the source files
|
||||
// for explicit processing.
|
||||
if (!this->GetGlobalGenerator()->IsMultiConfig() ||
|
||||
this->GetGlobalGenerator()->IsXcode()) {
|
||||
target->AddSourceFileToUnityBatch(sf->ResolveFullPath());
|
||||
}
|
||||
target->AddSourceFileToUnityBatch(sf->ResolveFullPath());
|
||||
sf->SetProperty("UNITY_SOURCE_FILE", filename.c_str());
|
||||
|
||||
if (beforeInclude) {
|
||||
|
||||
@@ -2141,7 +2141,6 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
|
||||
this->WriteExtraSource(e1, si.Source);
|
||||
break;
|
||||
case cmGeneratorTarget::SourceKindHeader:
|
||||
case cmGeneratorTarget::SourceKindUnityBatched:
|
||||
this->WriteHeaderSource(e1, si.Source);
|
||||
break;
|
||||
case cmGeneratorTarget::SourceKindIDL:
|
||||
@@ -2153,6 +2152,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
|
||||
case cmGeneratorTarget::SourceKindModuleDefinition:
|
||||
tool = "None";
|
||||
break;
|
||||
case cmGeneratorTarget::SourceKindUnityBatched:
|
||||
case cmGeneratorTarget::SourceKindObjectSource: {
|
||||
const std::string& lang = si.Source->GetLanguage();
|
||||
if (lang == "C" || lang == "CXX") {
|
||||
|
||||
Reference in New Issue
Block a user