summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx4
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx42
-rw-r--r--Source/cmGlobalXCodeGenerator.h2
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx2
-rw-r--r--Source/cmTarget.cxx1
6 files changed, 44 insertions, 9 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 5292bb791d..535a5803dd 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 18)
-set(CMake_VERSION_PATCH 20200902)
+set(CMake_VERSION_PATCH 20200903)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 3cfdb8a4b0..e3a51ddee4 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1215,7 +1215,8 @@ void cmGlobalNinjaGenerator::AppendTargetDependsClosure(
for (auto const& dep_target : this->GetTargetDirectDepends(target)) {
if (!dep_target->IsInBuildSystem() ||
- (this->EnableCrossConfigBuild() && !dep_target.IsCross())) {
+ (target->GetType() != cmStateEnums::UTILITY &&
+ this->EnableCrossConfigBuild() && !dep_target.IsCross())) {
continue;
}
@@ -1911,6 +1912,7 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
byproducts.push_back(
this->BuildAlias(GetByproductsForCleanTargetName(), config));
}
+ byproducts.emplace_back(GetByproductsForCleanTargetName());
build.Variables["TARGETS"] = cmJoin(byproducts, " ");
for (auto const& fileConfig : configs) {
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 1cd73a0060..dbc95e6657 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -679,6 +679,7 @@ void cmGlobalXCodeGenerator::ClearXCodeObjects()
this->FileRefs.clear();
this->ExternalLibRefs.clear();
this->FileRefToBuildFileMap.clear();
+ this->CommandsVisited.clear();
}
void cmGlobalXCodeGenerator::addObject(std::unique_ptr<cmXCodeObject> obj)
@@ -1271,6 +1272,16 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget(
return true;
}
+ auto& gtgt_visited = this->CommandsVisited[gtgt];
+ auto& deps = this->GetTargetDirectDepends(gtgt);
+ for (auto& d : deps) {
+ // Take the union of visited source files of custom commands so far.
+ // ComputeTargetOrder ensures our dependencies already visited their
+ // custom commands and updated CommandsVisited.
+ auto& dep_visited = this->CommandsVisited[d];
+ gtgt_visited.insert(dep_visited.begin(), dep_visited.end());
+ }
+
if (gtgt->GetType() == cmStateEnums::UTILITY ||
gtgt->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
gtgt->GetType() == cmStateEnums::GLOBAL_TARGET) {
@@ -1628,8 +1639,9 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(
}
// add all the sources
std::vector<cmCustomCommand> commands;
+ auto& visited = this->CommandsVisited[gtgt];
for (auto sourceFile : classes) {
- if (sourceFile->GetCustomCommand()) {
+ if (sourceFile->GetCustomCommand() && visited.insert(sourceFile).second) {
commands.push_back(*sourceFile->GetCustomCommand());
}
}
@@ -1839,6 +1851,15 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
for (auto const& command : commands) {
cmCustomCommandGenerator ccg(command, configName,
this->CurrentLocalGenerator);
+ std::vector<std::string> realDepends;
+ realDepends.reserve(ccg.GetDepends().size());
+ for (auto const& d : ccg.GetDepends()) {
+ std::string dep;
+ if (this->CurrentLocalGenerator->GetRealDependency(d, configName, dep)) {
+ realDepends.emplace_back(std::move(dep));
+ }
+ }
+
if (ccg.GetNumberOfCommands() > 0) {
makefileStream << "\n";
const std::vector<std::string>& outputs = ccg.GetOutputs();
@@ -1854,12 +1875,8 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
// There are no outputs. Use the generated force rule name.
makefileStream << tname[&ccg.GetCC()] << ": ";
}
- for (auto const& d : ccg.GetDepends()) {
- std::string dep;
- if (this->CurrentLocalGenerator->GetRealDependency(d, configName,
- dep)) {
- makefileStream << "\\\n" << this->ConvertToRelativeForMake(dep);
- }
+ for (auto const& dep : realDepends) {
+ makefileStream << "\\\n" << this->ConvertToRelativeForMake(dep);
}
makefileStream << "\n";
@@ -1888,6 +1905,17 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
ccg.AppendArguments(c, cmd);
makefileStream << "\t" << cmd << "\n";
}
+
+ // Symbolic inputs are not expected to exist, so add dummy rules.
+ for (auto const& dep : realDepends) {
+ if (cmSourceFile* dsf =
+ target->GetLocalGenerator()->GetMakefile()->GetSource(
+ dep, cmSourceFileLocationKind::Known)) {
+ if (dsf->GetPropertyAsBool("SYMBOLIC")) {
+ makefileStream << this->ConvertToRelativeForMake(dep) << ":\n";
+ }
+ }
+ }
}
}
}
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index f9b6300cdc..c02cc1d3dd 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -306,6 +306,8 @@ private:
std::string GeneratorToolset;
std::map<cmGeneratorTarget const*, size_t> TargetOrderIndex;
std::vector<std::string> EnabledLangs;
+ std::map<cmGeneratorTarget const*, std::set<cmSourceFile const*>>
+ CommandsVisited;
};
#endif
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 9508bb903c..ad1d5f1cdb 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -100,6 +100,8 @@ void cmNinjaUtilityTargetGenerator::Generate(const std::string& config)
if (genTarget->Target->GetType() != cmStateEnums::GLOBAL_TARGET) {
lg->AppendTargetOutputs(genTarget, gg->GetByproductsForCleanTarget(),
config);
+ std::copy(util_outputs.begin(), util_outputs.end(),
+ std::back_inserter(gg->GetByproductsForCleanTarget()));
}
lg->AppendTargetDepends(genTarget, deps, config, config,
DependOnTargetArtifact);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e0b8dff320..ba648b7e53 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -325,6 +325,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
initProp("Fortran_MODULE_DIRECTORY");
initProp("Fortran_COMPILER_LAUNCHER");
initProp("Fortran_PREPROCESS");
+ initProp("Fortran_VISIBILITY_PRESET");
initProp("GNUtoMS");
initProp("OSX_ARCHITECTURES");
initProp("IOS_INSTALL_COMBINED");