2016-09-27 19:01:08 +00:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2002-08-28 18:49:25 +00:00
|
|
|
#include "cmTryCompileCommand.h"
|
2003-06-23 12:58:58 +00:00
|
|
|
|
2016-10-25 18:35:04 +00:00
|
|
|
#include "cmMakefile.h"
|
2018-11-22 03:36:50 +00:00
|
|
|
#include "cmMessageType.h"
|
2016-10-25 18:35:04 +00:00
|
|
|
#include "cmake.h"
|
|
|
|
|
|
|
|
class cmExecutionStatus;
|
|
|
|
|
2007-05-24 15:27:51 +00:00
|
|
|
// cmTryCompileCommand
|
2016-05-16 14:34:04 +00:00
|
|
|
bool cmTryCompileCommand::InitialPass(std::vector<std::string> const& argv,
|
|
|
|
cmExecutionStatus&)
|
2002-09-19 13:49:14 +00:00
|
|
|
{
|
2016-05-16 14:34:04 +00:00
|
|
|
if (argv.size() < 3) {
|
2002-09-19 13:49:14 +00:00
|
|
|
return false;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2002-09-19 13:49:14 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
if (this->Makefile->GetCMakeInstance()->GetWorkingMode() ==
|
|
|
|
cmake::FIND_PACKAGE_MODE) {
|
|
|
|
this->Makefile->IssueMessage(
|
2018-11-22 03:36:50 +00:00
|
|
|
MessageType::FATAL_ERROR,
|
2016-05-16 14:34:04 +00:00
|
|
|
"The TRY_COMPILE() command is not supported in --find-package mode.");
|
2011-09-15 14:28:35 +00:00
|
|
|
return false;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2011-09-15 14:28:35 +00:00
|
|
|
|
2016-02-19 18:23:48 +00:00
|
|
|
this->TryCompileCode(argv, false);
|
2002-09-23 17:32:14 +00:00
|
|
|
|
2007-05-24 15:27:51 +00:00
|
|
|
// if They specified clean then we clean up what we can
|
2016-05-16 14:34:04 +00:00
|
|
|
if (this->SrcFileSignature) {
|
|
|
|
if (!this->Makefile->GetCMakeInstance()->GetDebugTryCompile()) {
|
2018-01-31 15:20:02 +00:00
|
|
|
this->CleanupFiles(this->BinaryDirectory);
|
2002-09-23 15:06:01 +00:00
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2007-05-24 15:27:51 +00:00
|
|
|
return true;
|
2002-09-23 15:06:01 +00:00
|
|
|
}
|