summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-20 16:53:54 +0000
committerKitware Robot <kwrobot@kitware.com>2020-01-20 11:54:13 -0500
commit6a5a23ea929c1ac85cb04dbf125be0f5f54d294c (patch)
tree715b20ce2aa9a86100efcc91b6169e66b0bb821a
parentbf3142e2533596de084400c2de4577250ed335c1 (diff)
parent086d9b2bab926b673bcb88a87a188586e76de3d6 (diff)
downloadcmake-6a5a23ea929c1ac85cb04dbf125be0f5f54d294c.tar.gz
Merge topic 'autogen_rcc_skip_unity'
086d9b2bab Autogen: Enable SKIP_UNITY_BUILD_INCLUSION on AUTORCC generated files Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Cristian Adam <cristian.adam@gmail.com> Merge-request: !4237
-rw-r--r--Source/cmQtAutoGenInitializer.cxx24
-rw-r--r--Source/cmQtAutoGenInitializer.h9
2 files changed, 19 insertions, 14 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 2edff25f65..ebb522b0a9 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -1219,7 +1219,10 @@ bool cmQtAutoGenInitializer::InitRccTargets()
// Register info file as generated by CMake
this->Makefile->AddCMakeOutputFile(qrc.InfoFile);
// Register file at target
- this->AddGeneratedSource(qrc.OutputFile, this->Rcc);
+ {
+ cmSourceFile* sf = this->AddGeneratedSource(qrc.OutputFile, this->Rcc);
+ sf->SetProperty("SKIP_UNITY_BUILD_INCLUSION", "On");
+ }
std::vector<std::string> ccOutput;
ccOutput.push_back(qrc.OutputFile);
@@ -1514,27 +1517,30 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo()
return true;
}
-void cmQtAutoGenInitializer::RegisterGeneratedSource(
+cmSourceFile* cmQtAutoGenInitializer::RegisterGeneratedSource(
std::string const& filename)
{
cmSourceFile* gFile = this->Makefile->GetOrCreateSource(filename, true);
gFile->SetProperty("GENERATED", "1");
gFile->SetProperty("SKIP_AUTOGEN", "1");
+ return gFile;
}
-bool cmQtAutoGenInitializer::AddGeneratedSource(std::string const& filename,
- GenVarsT const& genVars,
- bool prepend)
+cmSourceFile* cmQtAutoGenInitializer::AddGeneratedSource(
+ std::string const& filename, GenVarsT const& genVars, bool prepend)
{
// Register source at makefile
- this->RegisterGeneratedSource(filename);
+ cmSourceFile* gFile = this->RegisterGeneratedSource(filename);
// Add source file to target
this->GenTarget->AddSource(filename, prepend);
+
// Add source file to source group
- return this->AddToSourceGroup(filename, genVars.GenNameUpper);
+ this->AddToSourceGroup(filename, genVars.GenNameUpper);
+
+ return gFile;
}
-bool cmQtAutoGenInitializer::AddToSourceGroup(std::string const& fileName,
+void cmQtAutoGenInitializer::AddToSourceGroup(std::string const& fileName,
cm::string_view genNameUpper)
{
cmSourceGroup* sourceGroup = nullptr;
@@ -1565,14 +1571,12 @@ bool cmQtAutoGenInitializer::AddToSourceGroup(std::string const& fileName,
cmStrCat(genNameUpper, " error in ", property,
": Could not find or create the source group ",
cmQtAutoGen::Quoted(groupName)));
- return false;
}
}
}
if (sourceGroup != nullptr) {
sourceGroup->AddGroupFile(fileName);
}
- return true;
}
void cmQtAutoGenInitializer::AddCleanFile(std::string const& fileName)
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index 847e4e544f..8cedf14b9d 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -129,10 +129,11 @@ private:
bool SetupWriteAutogenInfo();
bool SetupWriteRccInfo();
- void RegisterGeneratedSource(std::string const& filename);
- bool AddGeneratedSource(std::string const& filename, GenVarsT const& genVars,
- bool prepend = false);
- bool AddToSourceGroup(std::string const& fileName,
+ cmSourceFile* RegisterGeneratedSource(std::string const& filename);
+ cmSourceFile* AddGeneratedSource(std::string const& filename,
+ GenVarsT const& genVars,
+ bool prepend = false);
+ void AddToSourceGroup(std::string const& fileName,
cm::string_view genNameUpper);
void AddCleanFile(std::string const& fileName);