summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-09-13 12:42:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-09-13 12:42:55 (GMT)
commita8c50d6faf8cd91ad8a338b41b9140c687bc27ca (patch)
tree971741b7d4c2da00542310a613d533b35c6e3f5b /Source
parent6686caf74c315cce85bfe7de48bfb3d21dead368 (diff)
parent09b650d00097863c03bff6c46122a7f366c4ddd2 (diff)
downloadCMake-a8c50d6faf8cd91ad8a338b41b9140c687bc27ca.zip
CMake-a8c50d6faf8cd91ad8a338b41b9140c687bc27ca.tar.gz
CMake-a8c50d6faf8cd91ad8a338b41b9140c687bc27ca.tar.bz2
Merge topic 'orkun_21677_16_06_2023'
09b650d000 Autogen: Move QtAutoMocDeps tests to RunCMake/Autogen ebc9e448b3 Autogen: Add depfile support for Makefiles e5358b9d8d RunCMake: Add RunCMake_TEST_NOT_EXPECT variables Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8570
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGenInitializer.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index c9f65f6..b1d90ee 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -1177,17 +1177,22 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
this->Makefile->AddCMakeOutputFile(this->AutogenTarget.InfoFile);
// Determine whether to use a depfile for the AUTOGEN target.
- const bool useNinjaDepfile = this->QtVersion >= IntegerVersion(5, 15) &&
- this->GlobalGen->GetName().find("Ninja") != std::string::npos;
+ bool const useDepfile = [this]() -> bool {
+ auto const& gen = this->GlobalGen->GetName();
+ return this->QtVersion >= IntegerVersion(5, 15) &&
+ (gen.find("Ninja") != std::string::npos ||
+ gen.find("Make") != std::string::npos);
+ }();
// Files provided by the autogen target
std::vector<std::string> autogenByproducts;
std::vector<std::string> timestampByproducts;
if (this->Moc.Enabled) {
this->AddGeneratedSource(this->Moc.CompilationFile, this->Moc, true);
- if (useNinjaDepfile) {
+ if (useDepfile) {
if (this->MultiConfig &&
- !this->Makefile->GetSafeDefinition("CMAKE_CROSS_CONFIGS").empty()) {
+ !this->Makefile->GetSafeDefinition("CMAKE_CROSS_CONFIGS").empty() &&
+ this->GlobalGen->GetName().find("Ninja") != std::string::npos) {
// Make all mocs_compilation_<CONFIG>.cpp files byproducts of the
// ${target}_autogen/timestamp custom command.
// We cannot just use Moc.CompilationFileGenex here, because that
@@ -1365,7 +1370,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
this->AutogenTarget.DependFiles.begin(),
this->AutogenTarget.DependFiles.end());
- if (useNinjaDepfile) {
+ if (useDepfile) {
// Create a custom command that generates a timestamp file and
// has a depfile assigned. The depfile is created by JobDepFilesMergeT.
//
@@ -1472,7 +1477,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
autogenTarget->AddUtility(depName.Value.first, false, this->Makefile);
}
}
- if (!useNinjaDepfile) {
+ if (!useDepfile) {
// Add additional autogen target dependencies to autogen target
for (cmTarget const* depTarget : this->AutogenTarget.DependTargets) {
autogenTarget->AddUtility(depTarget->GetName(), false, this->Makefile);