diff options
Diffstat (limited to 'Source/cmTryCompileCommand.cxx')
-rw-r--r-- | Source/cmTryCompileCommand.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx index b59c225..a2c4ce1 100644 --- a/Source/cmTryCompileCommand.cxx +++ b/Source/cmTryCompileCommand.cxx @@ -16,12 +16,15 @@ bool cmTryCompileCommand(std::vector<std::string> const& args, cmExecutionStatus& status) { + cmMakefile& mf = status.GetMakefile(); + if (args.size() < 3) { + mf.IssueMessage( + MessageType::FATAL_ERROR, + "The try_compile() command requires at least 3 arguments."); return false; } - cmMakefile& mf = status.GetMakefile(); - if (mf.GetCMakeInstance()->GetWorkingMode() == cmake::FIND_PACKAGE_MODE) { mf.IssueMessage( MessageType::FATAL_ERROR, |