diff options
author | Brad King <brad.king@kitware.com> | 2016-10-20 14:36:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-10-20 14:37:27 (GMT) |
commit | 2d3aa94225e259c9bc1c0d469e6326b476d225c1 (patch) | |
tree | b88191eb67c139f7a75cb74bfc517962d5c4f6eb /Source/cmGlobalGenerator.cxx | |
parent | 7aa9961939f99c915485d86e460b9941f949d59c (diff) | |
download | CMake-2d3aa94225e259c9bc1c0d469e6326b476d225c1.zip CMake-2d3aa94225e259c9bc1c0d469e6326b476d225c1.tar.gz CMake-2d3aa94225e259c9bc1c0d469e6326b476d225c1.tar.bz2 |
cmGlobalGenerator: Allow FindMakeProgram to fail
Revise its signature to return `bool` so that it can fail and abort
configuration early.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index b4ede1d..cf51c6a 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -269,12 +269,13 @@ bool cmGlobalGenerator::IsExportedTargetsFile( } // Find the make program for the generator, required for try compiles -void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) +bool cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) { if (this->FindMakeProgramFile.empty()) { cmSystemTools::Error( "Generator implementation error, " "all generators must specify this->FindMakeProgramFile"); + return false; } if (!mf->GetDefinition("CMAKE_MAKE_PROGRAM") || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) { @@ -292,7 +293,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) << "probably need to select a different build tool."; cmSystemTools::Error(err.str().c_str()); cmSystemTools::SetFatalErrorOccured(); - return; + return false; } std::string makeProgram = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); // if there are spaces in the make program use short path @@ -311,6 +312,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", makeProgram.c_str(), "make program", cmStateEnums::FILEPATH); } + return true; } bool cmGlobalGenerator::CheckLanguages( @@ -426,7 +428,9 @@ void cmGlobalGenerator::EnableLanguage( mf->AddDefinition("CMAKE_PLATFORM_INFO_DIR", rootBin.c_str()); // find and make sure CMAKE_MAKE_PROGRAM is defined - this->FindMakeProgram(mf); + if (!this->FindMakeProgram(mf)) { + return; + } if (!this->CheckLanguages(languages, mf)) { return; |