try_compile: Report build dir with --debug-trycompile

When `--debug-trycompile` is enabled, issue a log (with trace) for every
`try_compile` noting what directory is being used for the compilation.
This will make it easier to find the corresponding artifacts.

Closes: #24022
This commit is contained in:
Matthew Woehlke
2022-10-04 16:42:54 -04:00
committed by Brad King
parent cbf3252975
commit 7e6b2a92a0
6 changed files with 49 additions and 1 deletions
+7
View File
@@ -1050,6 +1050,13 @@ bool cmCoreTryCompile::TryCompileCode(Arguments& arguments,
}
}
if (this->Makefile->GetCMakeInstance()->GetDebugTryCompile()) {
auto msg =
cmStrCat("Executing try_compile (", *arguments.CompileResultVariable,
") in:\n ", this->BinaryDirectory);
this->Makefile->IssueMessage(MessageType::LOG, msg);
}
bool erroroc = cmSystemTools::GetErrorOccurredFlag();
cmSystemTools::ResetErrorOccurredFlag();
std::string output;