cmTryCompileCommand.cxx 988 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmTryCompileCommand.h"
  4. #include "cmMakefile.h"
  5. #include "cmake.h"
  6. class cmExecutionStatus;
  7. // cmTryCompileCommand
  8. bool cmTryCompileCommand::InitialPass(std::vector<std::string> const& argv,
  9. cmExecutionStatus&)
  10. {
  11. if (argv.size() < 3) {
  12. return false;
  13. }
  14. if (this->Makefile->GetCMakeInstance()->GetWorkingMode() ==
  15. cmake::FIND_PACKAGE_MODE) {
  16. this->Makefile->IssueMessage(
  17. cmake::FATAL_ERROR,
  18. "The TRY_COMPILE() command is not supported in --find-package mode.");
  19. return false;
  20. }
  21. this->TryCompileCode(argv, false);
  22. // if They specified clean then we clean up what we can
  23. if (this->SrcFileSignature) {
  24. if (!this->Makefile->GetCMakeInstance()->GetDebugTryCompile()) {
  25. this->CleanupFiles(this->BinaryDirectory);
  26. }
  27. }
  28. return true;
  29. }