diff options
author | Harry Mallon <hjmallon@gmail.com> | 2017-07-13 14:46:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-07-14 14:38:00 (GMT) |
commit | 0348383b8ccb943a68cda3ecf1bdd609212ff5ca (patch) | |
tree | 665edcc843407141691551b1f82c1c5626c03cce /Source/cmGlobalXCodeGenerator.cxx | |
parent | 25b72e9097260d1faf254155a1199886c808a58f (diff) | |
download | CMake-0348383b8ccb943a68cda3ecf1bdd609212ff5ca.zip CMake-0348383b8ccb943a68cda3ecf1bdd609212ff5ca.tar.gz CMake-0348383b8ccb943a68cda3ecf1bdd609212ff5ca.tar.bz2 |
Xcode: Add "outputPaths" to custom command script build phase
This is needed for Xcode 9's "New Build System", whose release notes
mention "that output must be declared as an explicit output by the
script which generates it" in reference to outputs of custom script
build phases.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 9037961..3cd14e1 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1517,6 +1517,17 @@ void cmGlobalXCodeGenerator::AddCommandsToBuildPhase( makecmd += " all"; buildphase->AddAttribute("shellScript", this->CreateString(makecmd)); buildphase->AddAttribute("showEnvVarsInLog", this->CreateString("0")); + + cmXCodeObject* outputFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST); + for (std::vector<cmCustomCommand>::const_iterator i = commands.begin(); + i != commands.end(); ++i) { + std::vector<std::string> const& outputs = i->GetOutputs(); + for (std::vector<std::string>::const_iterator j = outputs.begin(); + j != outputs.end(); ++j) { + outputFiles->AddObject(this->CreateString(*j)); + } + } + buildphase->AddAttribute("outputPaths", outputFiles); } void cmGlobalXCodeGenerator::CreateCustomRulesMakefile( |