summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:13:19 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:13:19 +0900
commitc5f1ff3b8bce56839eb20ff7bd17cbcd3af13a29 (patch)
treee248ed882afb531975482715ba127e1714b2f60c /Source
parent5dfa20f6e3908ae58658cd105297f8aa3b4eb1d6 (diff)
downloadcmake-c5f1ff3b8bce56839eb20ff7bd17cbcd3af13a29.tar.gz
cmake-c5f1ff3b8bce56839eb20ff7bd17cbcd3af13a29.tar.bz2
cmake-c5f1ff3b8bce56839eb20ff7bd17cbcd3af13a29.zip
Imported Upstream version 3.11.2upstream/3.11.2
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/Checks/cm_cxx_features.cmake3
-rw-r--r--Source/cmAddLibraryCommand.cxx8
-rw-r--r--Source/cmCustomCommandGenerator.cxx8
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.cxx6
-rw-r--r--Source/cmMakefile.cxx3
-rw-r--r--Source/cmNinjaTargetGenerator.cxx4
-rw-r--r--Source/cmQtAutoGenInitializer.cxx3
8 files changed, 34 insertions, 3 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index b69c12586..260070680 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 11)
-set(CMake_VERSION_PATCH 1)
+set(CMake_VERSION_PATCH 2)
#set(CMake_VERSION_RC 0)
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 2704c4032..2a1abbab6 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -19,6 +19,9 @@ function(cm_check_cxx_feature name)
string(REGEX REPLACE " +0 Warning\\(s\\)" "" check_output "${check_output}")
# Filter out warnings caused by user flags.
string(REGEX REPLACE "[^\n]*warning:[^\n]*-Winvalid-command-line-argument[^\n]*" "" check_output "${check_output}")
+ # Filter out warnings caused by local configuration.
+ string(REGEX REPLACE "[^\n]*warning:[^\n]*directory not found for option[^\n]*" "" check_output "${check_output}")
+ string(REGEX REPLACE "[^\n]*warning:[^\n]*object file compiled with -mlong-branch which is no longer needed[^\n]*" "" check_output "${check_output}")
# If using the feature causes warnings, treat it as broken/unavailable.
if(check_output MATCHES "[Ww]arning")
set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE)
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 1278232ac..779223501 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -228,6 +228,14 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
this->SetError(e.str());
return false;
}
+ if (aliasedTarget->IsImported() &&
+ !aliasedTarget->IsImportedGloballyVisible()) {
+ std::ostringstream e;
+ e << "cannot create ALIAS target \"" << libName << "\" because target \""
+ << aliasedName << "\" is imported but not globally visible.";
+ this->SetError(e.str());
+ return false;
+ }
this->Makefile->AddAlias(libName, aliasedName);
return true;
}
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 136cf39be..6c9f9d6f4 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -40,6 +40,14 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
argv.push_back(std::move(parsed_arg));
}
}
+
+ // Later code assumes at least one entry exists, but expanding
+ // lists on an empty command may have left this empty.
+ // FIXME: Should we define behavior for removing empty commands?
+ if (argv.empty()) {
+ argv.push_back(std::string());
+ }
+
this->CommandLines.push_back(std::move(argv));
}
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index c54414193..99b926126 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -105,8 +105,14 @@ void cmGeneratorExpressionEvaluationFile::CreateOutputFile(
lg, config, false, nullptr, nullptr, nullptr, le);
cmSourceFile* sf = lg->GetMakefile()->GetOrCreateSource(
name, false, cmSourceFileLocationKind::Known);
+ // Tell TraceDependencies that the file is not expected to exist
+ // on disk yet. We generate it after that runs.
sf->SetProperty("GENERATED", "1");
+ // Tell the build system generators that there is no build rule
+ // to generate the file.
+ sf->SetProperty("__CMAKE_GENERATED_BY_CMAKE", "1");
+
gg->SetFilenameTargetDepends(
sf, this->OutputFileExpr->GetSourceSensitiveTargets());
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 71359a271..604ca2ca5 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2304,7 +2304,8 @@ bool cmMakefile::CanIWriteThisFile(std::string const& fileName) const
}
return !cmSystemTools::IsSubDirectory(fileName, this->GetHomeDirectory()) ||
- cmSystemTools::IsSubDirectory(fileName, this->GetHomeOutputDirectory());
+ cmSystemTools::IsSubDirectory(fileName, this->GetHomeOutputDirectory()) ||
+ cmSystemTools::SameFile(fileName, this->GetHomeOutputDirectory());
}
const char* cmMakefile::GetRequiredDefinition(const std::string& name) const
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index f4faf47a2..a6a3efbfb 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -896,7 +896,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
// (either attached to this source file or another one), assume that one of
// the target dependencies, OBJECT_DEPENDS or header file custom commands
// will rebuild the file.
- if (source->GetPropertyAsBool("GENERATED") && !source->GetCustomCommand() &&
+ if (source->GetPropertyAsBool("GENERATED") &&
+ !source->GetPropertyAsBool("__CMAKE_GENERATED_BY_CMAKE") &&
+ !source->GetCustomCommand() &&
!this->GetGlobalGenerator()->HasCustomCommandOutput(sourceFileName)) {
this->GetGlobalGenerator()->AddAssumedSourceDependencies(sourceFileName,
orderOnlyDeps);
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 93c78b5bd..566a2a98e 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -994,6 +994,9 @@ void cmQtAutoGenInitializer::SetupCustomTargets()
// Generate auto RCC info files
if (this->RccEnabled) {
for (Qrc const& qrc : this->Qrcs) {
+ // Register rcc info file as generated
+ makefile->AddCMakeOutputFile(qrc.InfoFile);
+
cmGeneratedFileStream ofs;
ofs.SetCopyIfDifferent(true);
ofs.Open(qrc.InfoFile.c_str(), false, true);