mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-12 09:08:58 -05:00
AutoMoc: Configure AutoMoc after generated sources (PCH, Unity)
Fixes: #20119
This commit is contained in:
@@ -1426,13 +1426,13 @@ bool cmGlobalGenerator::Compute()
|
||||
// so create the map from project name to vector of local generators
|
||||
this->FillProjectMap();
|
||||
|
||||
// Iterate through all targets and set up AUTOMOC, AUTOUIC and AUTORCC
|
||||
if (!this->QtAutoGen()) {
|
||||
// Add automatically generated sources (e.g. unity build).
|
||||
if (!this->AddAutomaticSources()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Add automatically generated sources (e.g. unity build).
|
||||
if (!this->AddAutomaticSources()) {
|
||||
// Iterate through all targets and set up AUTOMOC, AUTOUIC and AUTORCC
|
||||
if (!this->QtAutoGen()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -2750,9 +2750,14 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
|
||||
// Add pchHeader to source files, which will
|
||||
// be grouped as "Precompile Header File"
|
||||
auto pchHeader_sf = this->Makefile->GetOrCreateSource(
|
||||
pchHeader, false, cmSourceFileLocationKind::Known);
|
||||
pchHeader, true, cmSourceFileLocationKind::Known);
|
||||
std::string err;
|
||||
pchHeader_sf->ResolveFullPath(&err);
|
||||
|
||||
// The pch file is generated, but mark it as not generated
|
||||
// so that a clean operation will not remove it from disk
|
||||
pchHeader_sf->SetProperty("GENERATED", "0");
|
||||
|
||||
target->AddSource(pchHeader);
|
||||
}
|
||||
}
|
||||
@@ -2767,6 +2772,7 @@ inline void RegisterUnitySources(cmGeneratorTarget* target, cmSourceFile* sf,
|
||||
{
|
||||
target->AddSourceFileToUnityBatch(sf->ResolveFullPath());
|
||||
sf->SetProperty("UNITY_SOURCE_FILE", filename.c_str());
|
||||
sf->SetProperty("SKIP_AUTOGEN", "ON");
|
||||
}
|
||||
|
||||
inline void IncludeFileInUnitySources(cmGeneratedFileStream& unity_file,
|
||||
|
||||
Reference in New Issue
Block a user