Merge topic 'cmake--build-pipes'

bcd5de7 cmake: Always pass through stdout/stderr in --build mode
This commit is contained in:
Brad King 2013-10-22 09:07:23 -04:00 committed by CMake Topic Stage
commit 61de941ad7
4 changed files with 8 additions and 16 deletions

View File

@ -58,10 +58,7 @@ native tool on their platform.
--config <cfg> = For multi-configuration tools, choose <cfg>. --config <cfg> = For multi-configuration tools, choose <cfg>.
--clean-first = Build target 'clean' first, then build. --clean-first = Build target 'clean' first, then build.
(To clean only, use --target 'clean'.) (To clean only, use --target 'clean'.)
--use-stderr = Don't merge stdout/stderr output and pass the --use-stderr = Ignored. Behavior is default in CMake >= 3.0.
original stdout/stderr handles to the native
tool so it can use the capabilities of the
calling terminal (e.g. colored output).
-- = Pass remaining options to the native tool. -- = Pass remaining options to the native tool.
Run cmake --build with no options for quick help. Run cmake --build with no options for quick help.

View File

@ -2871,8 +2871,7 @@ int cmake::Build(const std::string& dir,
const std::string& target, const std::string& target,
const std::string& config, const std::string& config,
const std::vector<std::string>& nativeOptions, const std::vector<std::string>& nativeOptions,
bool clean, bool clean)
cmSystemTools::OutputOption outputflag)
{ {
if(!cmSystemTools::FileIsDirectory(dir.c_str())) if(!cmSystemTools::FileIsDirectory(dir.c_str()))
{ {
@ -2914,7 +2913,8 @@ int cmake::Build(const std::string& dir,
projName.c_str(), target.c_str(), projName.c_str(), target.c_str(),
&output, &output,
makeProgram.c_str(), makeProgram.c_str(),
config.c_str(), clean, false, 0, outputflag, config.c_str(), clean, false, 0,
cmSystemTools::OUTPUT_PASSTHROUGH,
0, nativeOptions); 0, nativeOptions);
} }

View File

@ -362,8 +362,7 @@ class cmake
const std::string& target, const std::string& target,
const std::string& config, const std::string& config,
const std::vector<std::string>& nativeOptions, const std::vector<std::string>& nativeOptions,
bool clean, bool clean);
cmSystemTools::OutputOption outputflag);
void UnwatchUnusedCli(const char* var); void UnwatchUnusedCli(const char* var);
void WatchUnusedCli(const char* var); void WatchUnusedCli(const char* var);

View File

@ -49,10 +49,7 @@ static const char * cmDocumentationUsage[][2] =
" --config <cfg> = For multi-configuration tools, choose <cfg>.\n" \ " --config <cfg> = For multi-configuration tools, choose <cfg>.\n" \
" --clean-first = Build target 'clean' first, then build.\n" \ " --clean-first = Build target 'clean' first, then build.\n" \
" (To clean only, use --target 'clean'.)\n" \ " (To clean only, use --target 'clean'.)\n" \
" --use-stderr = Don't merge stdout/stderr output and pass the\n" \ " --use-stderr = Ignored. Behavior is default in CMake >= 3.0.\n" \
" original stdout/stderr handles to the native\n" \
" tool so it can use the capabilities of the\n" \
" calling terminal (e.g. colored output).\n" \
" -- = Pass remaining options to the native tool.\n" " -- = Pass remaining options to the native tool.\n"
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -368,7 +365,6 @@ static int do_build(int ac, char** av)
std::string dir; std::string dir;
std::vector<std::string> nativeOptions; std::vector<std::string> nativeOptions;
bool clean = false; bool clean = false;
cmSystemTools::OutputOption outputflag = cmSystemTools::OUTPUT_MERGE;
enum Doing { DoingNone, DoingDir, DoingTarget, DoingConfig, DoingNative}; enum Doing { DoingNone, DoingDir, DoingTarget, DoingConfig, DoingNative};
Doing doing = DoingDir; Doing doing = DoingDir;
@ -393,7 +389,7 @@ static int do_build(int ac, char** av)
} }
else if(strcmp(av[i], "--use-stderr") == 0) else if(strcmp(av[i], "--use-stderr") == 0)
{ {
outputflag = cmSystemTools::OUTPUT_PASSTHROUGH; /* tolerate legacy option */
} }
else if(strcmp(av[i], "--") == 0) else if(strcmp(av[i], "--") == 0)
{ {
@ -440,6 +436,6 @@ static int do_build(int ac, char** av)
} }
cmake cm; cmake cm;
return cm.Build(dir, target, config, nativeOptions, clean, outputflag); return cm.Build(dir, target, config, nativeOptions, clean);
#endif #endif
} }