Commit 1e0b1ace authored by Robert Maynard's avatar Robert Maynard

cmGlobalXCodeGenerator: Support verbose build command.

parent 7b2d9dcf
......@@ -1874,9 +1874,11 @@ int cmGlobalGenerator::Build(int jobs, const std::string& /*unused*/,
output += makeCommandStr;
output += "\n";
if (!cmSystemTools::RunSingleCommand(makeCommand.PrimaryCommand, outputPtr,
outputPtr, &retVal, nullptr, outputflag,
timeout)) {
std::vector<const std::vector<std::string>*> commands = {
&makeCommand.PrimaryCommand, &makeCommand.SecondaryCommand
if (!cmSystemTools::RunMultiCommand(commands, outputPtr, outputPtr, &retVal,
nullptr, outputflag, timeout)) {
"Generator: execution of make failed. Make command was: " +
......@@ -84,7 +84,23 @@ struct GeneratedMakeCommand
return buffer;
// Add each argument as a separate element to the vector
template <typename... T>
void addSecondary(T&&... args)
// iterate the args and append each one
AppendStrs(SecondaryCommand, std::forward<T>(args)...);
// Add each value in the iterators as a separate element to the vector
void addSecondary(std::vector<std::string>::const_iterator start,
std::vector<std::string>::const_iterator end)
SecondaryCommand.insert(SecondaryCommand.end(), start, end);
std::vector<std::string> PrimaryCommand;
std::vector<std::string> SecondaryCommand;
bool RequiresOutputForward = false;
......@@ -338,7 +338,7 @@ void cmGlobalXCodeGenerator::GenerateBuildCommand(
GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& /*projectDir*/,
const std::string& targetName, const std::string& config, bool /*fast*/,
int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
int jobs, bool verbose, std::vector<std::string> const& makeOptions)
// now build the test
......@@ -374,6 +374,23 @@ void cmGlobalXCodeGenerator::GenerateBuildCommand(
makeCommand.add(makeOptions.begin(), makeOptions.end());
if (!verbose) {
//tell xcode to be quiet. We don't get progress showing what targets
//have been built, we get proper error messages and warnings
//This requires the external xcpretty ruby application
//Also has problems with 'note:' lines that show up as part of error messages
// makeCommand.addSecondary("xcpretty");
// makeCommand.addSecondary("--no-utf");
//This fails to capture all-errors.
// If we can pipe errors directly to console this might work
// makeCommand.addSecondary("grep" asd);
// makeCommand.addSecondary("-E"); //extended regex
// makeCommand.addSecondary("^==|^Ld|^Compile|^\\*\\*"); //only lines that match...
///! Create a local generator appropriate to this Global Generator
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment