summaryrefslogtreecommitdiffstats
path: root/Source/cmBuildCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-03-12 22:12:52 (GMT)
committerBrad King <brad.king@kitware.com>2013-03-12 22:17:40 (GMT)
commit2e1c2bd2dd97e426944d6ac18e4073ec26ddf64c (patch)
treeab1b249476f3b36baac84b5a970da85dcbb51c10 /Source/cmBuildCommand.cxx
parent4e5cb375901293e8fedb5d8e44d1481e3f6799d6 (diff)
downloadCMake-2e1c2bd2dd97e426944d6ac18e4073ec26ddf64c.zip
CMake-2e1c2bd2dd97e426944d6ac18e4073ec26ddf64c.tar.gz
CMake-2e1c2bd2dd97e426944d6ac18e4073ec26ddf64c.tar.bz2
build_command: Fail early without CMAKE_MAKE_PROGRAM (#14005)
If CMAKE_MAKE_PROGRAM is not set fail with an error message instead of crashing. Suggest calling project() or enable_language() first to ensure that CMAKE_MAKE_PROGRAM is set.
Diffstat (limited to 'Source/cmBuildCommand.cxx')
-rw-r--r--Source/cmBuildCommand.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx
index 3722ab6..91d55a5 100644
--- a/Source/cmBuildCommand.cxx
+++ b/Source/cmBuildCommand.cxx
@@ -87,6 +87,14 @@ bool cmBuildCommand
const char* makeprogram
= this->Makefile->GetDefinition("CMAKE_MAKE_PROGRAM");
+ if(!makeprogram)
+ {
+ this->Makefile->IssueMessage(
+ cmake::FATAL_ERROR,
+ "build_command() requires CMAKE_MAKE_PROGRAM to be defined. "
+ "Call project() or enable_language() first.");
+ return true;
+ }
// If null/empty CONFIGURATION argument, GenerateBuildCommand uses 'Debug'
// in the currently implemented multi-configuration global generators...