diff options
author | Brad King <brad.king@kitware.com> | 2018-07-19 16:47:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-07-19 17:40:54 (GMT) |
commit | fb45559e0924467523bd372a3c037861d8b11c51 (patch) | |
tree | 1584955147d0ad11f7f1e648114ee210d032ff79 | |
parent | 0bad9eba46f6899a4c59431e7136a868d0003854 (diff) | |
download | CMake-fb45559e0924467523bd372a3c037861d8b11c51.zip CMake-fb45559e0924467523bd372a3c037861d8b11c51.tar.gz CMake-fb45559e0924467523bd372a3c037861d8b11c51.tar.bz2 |
Xcode: Process targets in depth-first order during generation
The Xcode 10 "new build system" requires more strict handling of custom
commands. It may need a fix similar to what commit v3.12.0-rc1~171^2
(VS: Generate a custom command only in the least dependent target,
2018-03-23) did for VS. Prepare for this by generating targets within
each local generator in dependency order.
Issue: #18070
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index df4e507..042ce41 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1083,8 +1083,12 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets( cmLocalGenerator* gen, std::vector<cmXCodeObject*>& targets) { this->SetCurrentLocalGenerator(gen); - std::vector<cmGeneratorTarget*> const& gts = + std::vector<cmGeneratorTarget*> gts = this->CurrentLocalGenerator->GetGeneratorTargets(); + std::sort(gts.begin(), gts.end(), + [this](cmGeneratorTarget const* l, cmGeneratorTarget const* r) { + return this->TargetOrderIndex[l] < this->TargetOrderIndex[r]; + }); for (auto gtgt : gts) { if (!this->CreateXCodeTarget(gtgt, targets)) { return false; |