cmake/Source/cmTryCompileCommand.cxx

36 lines
988 B
C++
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmTryCompileCommand.h"
2017-04-14 19:02:05 +02:00
#include "cmMakefile.h"
#include "cmake.h"
class cmExecutionStatus;
// cmTryCompileCommand
2016-07-09 11:21:54 +02:00
bool cmTryCompileCommand::InitialPass(std::vector<std::string> const& argv,
cmExecutionStatus&)
{
2016-07-09 11:21:54 +02:00
if (argv.size() < 3) {
return false;
2016-07-09 11:21:54 +02:00
}
2016-07-09 11:21:54 +02:00
if (this->Makefile->GetCMakeInstance()->GetWorkingMode() ==
cmake::FIND_PACKAGE_MODE) {
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
"The TRY_COMPILE() command is not supported in --find-package mode.");
2012-02-18 12:40:36 +02:00
return false;
2016-07-09 11:21:54 +02:00
}
2012-02-18 12:40:36 +02:00
2016-07-09 11:21:54 +02:00
this->TryCompileCode(argv, false);
// if They specified clean then we clean up what we can
2016-07-09 11:21:54 +02:00
if (this->SrcFileSignature) {
if (!this->Makefile->GetCMakeInstance()->GetDebugTryCompile()) {
2018-04-23 21:13:27 +02:00
this->CleanupFiles(this->BinaryDirectory);
}
2016-07-09 11:21:54 +02:00
}
return true;
}