[Cmake-commits] CMake branch, next, updated. v3.0.0-4695-g0fbb6c7
Brad King
brad.king at kitware.com
Thu Jul 31 12:56:36 EDT 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 0fbb6c75b64851e51edbd1695120f826cfde20f1 (commit)
via 30983ebec1f242888560cff86e8789b3f02be056 (commit)
from 48ec39bce49ea2ffaf97e6726a3fa901aaca0eab (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0fbb6c75b64851e51edbd1695120f826cfde20f1
commit 0fbb6c75b64851e51edbd1695120f826cfde20f1
Merge: 48ec39b 30983eb
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 31 12:56:35 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jul 31 12:56:35 2014 -0400
Merge topic 'cmGlobalGenerator-Build-output-ref' into next
30983ebe cmGlobalGenerator: Take Build output argument by reference
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=30983ebec1f242888560cff86e8789b3f02be056
commit 30983ebec1f242888560cff86e8789b3f02be056
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 31 12:48:46 2014 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Jul 31 12:49:51 2014 -0400
cmGlobalGenerator: Take Build output argument by reference
No call sites pass NULL to the output argument, so take it by
reference to avoid the if(output) conditions. Propagate the
change through the TryCompile APIs that call it.
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index b4818be..627832c 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -301,7 +301,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
int retVal = cm.GetGlobalGenerator()->Build(
this->SourceDir, this->BinaryDir,
this->BuildProject, *tarIt,
- &output, this->BuildMakeProgram,
+ output, this->BuildMakeProgram,
config,
!this->BuildNoClean,
false, remainingTime);
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index a3f3277..ed19851 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -489,7 +489,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
targetName,
this->SrcFileSignature,
&cmakeFlags,
- &output);
+ output);
if ( erroroc )
{
cmSystemTools::SetErrorOccured();
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 249373c..38ba5d1 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1616,7 +1616,7 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir,
const std::string& bindir,
const std::string& projectName,
const std::string& target, bool fast,
- std::string *output, cmMakefile *mf)
+ std::string& output, cmMakefile *mf)
{
// if this is not set, then this is a first time configure
// and there is a good chance that the try compile stuff will
@@ -1675,7 +1675,7 @@ void cmGlobalGenerator::GenerateBuildCommand(
int cmGlobalGenerator::Build(
const std::string&, const std::string& bindir,
const std::string& projectName, const std::string& target,
- std::string *output,
+ std::string& output,
const std::string& makeCommandCSTR,
const std::string& config,
bool clean, bool fast,
@@ -1688,22 +1688,15 @@ int cmGlobalGenerator::Build(
*/
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(bindir.c_str());
- if(output)
- {
- *output += "Change Dir: ";
- *output += bindir;
- *output += "\n";
- }
+ output += "Change Dir: ";
+ output += bindir;
+ output += "\n";
int retVal;
bool hideconsole = cmSystemTools::GetRunCommandHideConsole();
cmSystemTools::SetRunCommandHideConsole(true);
std::string outputBuffer;
- std::string* outputPtr = 0;
- if(output)
- {
- outputPtr = &outputBuffer;
- }
+ std::string* outputPtr = &outputBuffer;
// should we do a clean first?
if (clean)
@@ -1711,32 +1704,23 @@ int cmGlobalGenerator::Build(
std::vector<std::string> cleanCommand;
this->GenerateBuildCommand(cleanCommand, makeCommandCSTR, projectName,
bindir, "clean", config, fast);
- if(output)
- {
- *output += "\nRun Clean Command:";
- *output += cmSystemTools::PrintSingleCommand(cleanCommand);
- *output += "\n";
- }
+ output += "\nRun Clean Command:";
+ output += cmSystemTools::PrintSingleCommand(cleanCommand);
+ output += "\n";
if (!cmSystemTools::RunSingleCommand(cleanCommand, outputPtr,
&retVal, 0, outputflag, timeout))
{
cmSystemTools::SetRunCommandHideConsole(hideconsole);
cmSystemTools::Error("Generator: execution of make clean failed.");
- if (output)
- {
- *output += *outputPtr;
- *output += "\nGenerator: execution of make clean failed.\n";
- }
+ output += *outputPtr;
+ output += "\nGenerator: execution of make clean failed.\n";
// return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str());
return 1;
}
- if (output)
- {
- *output += *outputPtr;
- }
+ output += *outputPtr;
}
// now build
@@ -1744,12 +1728,9 @@ int cmGlobalGenerator::Build(
this->GenerateBuildCommand(makeCommand, makeCommandCSTR, projectName,
bindir, target, config, fast, nativeOptions);
std::string makeCommandStr = cmSystemTools::PrintSingleCommand(makeCommand);
- if(output)
- {
- *output += "\nRun Build Command:";
- *output += makeCommandStr;
- *output += "\n";
- }
+ output += "\nRun Build Command:";
+ output += makeCommandStr;
+ output += "\n";
if (!cmSystemTools::RunSingleCommand(makeCommand, outputPtr,
&retVal, 0, outputflag, timeout))
@@ -1758,27 +1739,21 @@ int cmGlobalGenerator::Build(
cmSystemTools::Error
("Generator: execution of make failed. Make command was: ",
makeCommandStr.c_str());
- if (output)
- {
- *output += *outputPtr;
- *output += "\nGenerator: execution of make failed. Make command was: "
+ output += *outputPtr;
+ output += "\nGenerator: execution of make failed. Make command was: "
+ makeCommandStr + "\n";
- }
// return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str());
return 1;
}
- if (output)
- {
- *output += *outputPtr;
- }
+ output += *outputPtr;
cmSystemTools::SetRunCommandHideConsole(hideconsole);
// The SGI MipsPro 7.3 compiler does not return an error code when
// the source has a #error in it! This is a work-around for such
// compilers.
- if((retVal == 0) && (output->find("#error") != std::string::npos))
+ if((retVal == 0) && (output.find("#error") != std::string::npos))
{
retVal = 1;
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 6b608bb..f80c3c7 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -116,7 +116,7 @@ public:
virtual int TryCompile(const std::string& srcdir, const std::string& bindir,
const std::string& projectName,
const std::string& targetName,
- bool fast, std::string *output, cmMakefile* mf);
+ bool fast, std::string& output, cmMakefile* mf);
/**
@@ -127,7 +127,7 @@ public:
*/
int Build(const std::string& srcdir, const std::string& bindir,
const std::string& projectName, const std::string& targetName,
- std::string *output,
+ std::string& output,
const std::string& makeProgram, const std::string& config,
bool clean, bool fast,
double timeout,
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d3ca34a..04b2d27 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3510,7 +3510,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
const std::string& targetName,
bool fast,
const std::vector<std::string> *cmakeArgs,
- std::string *output)
+ std::string& output)
{
this->Internal->IsSourceFileTryCompile = fast;
// does the binary directory exist ? If not create it...
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 3a40c1c..d728a62 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -130,7 +130,7 @@ public:
const std::string& projectName, const std::string& targetName,
bool fast,
const std::vector<std::string> *cmakeArgs,
- std::string *output);
+ std::string& output);
bool GetIsSourceFileTryCompile() const;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 5aa1ab0..6cc3b81 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2757,7 +2757,7 @@ int cmake::Build(const std::string& dir,
projName = it.GetValue();
return gen->Build("", dir,
projName, target,
- &output,
+ output,
"",
config, clean, false, 0,
cmSystemTools::OUTPUT_PASSTHROUGH,
-----------------------------------------------------------------------
Summary of changes:
Source/CTest/cmCTestBuildAndTestHandler.cxx | 2 +-
Source/cmCoreTryCompile.cxx | 2 +-
Source/cmGlobalGenerator.cxx | 63 ++++++++-------------------
Source/cmGlobalGenerator.h | 4 +-
Source/cmMakefile.cxx | 2 +-
Source/cmMakefile.h | 2 +-
Source/cmake.cxx | 2 +-
7 files changed, 26 insertions(+), 51 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list