mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 10:47:59 +08:00
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.
This commit is contained in:
@@ -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...
|
||||
|
Reference in New Issue
Block a user