MCPcopy Create free account
hub / github.com/Kitware/CMake / WriteTryRunEvent

Function WriteTryRunEvent

Source/cmTryRunCommand.cxx:39–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38#ifndef CMAKE_BOOTSTRAP
39void WriteTryRunEvent(cmConfigureLog& log, cmMakefile const& mf,
40 cmTryCompileResult const& compileResult,
41 cmTryRunResult const& runResult)
42{
43 // Keep in sync with cmFileAPIConfigureLog's DumpEventKindNames.
44 static std::vector<unsigned int> const LogVersionsWithTryRunV1{ 1 };
45
46 if (log.IsAnyLogVersionEnabled(LogVersionsWithTryRunV1)) {
47 log.BeginEvent("try_run-v1", mf);
48 cmCoreTryCompile::WriteTryCompileEventFields(log, compileResult);
49
50 log.BeginObject("runResult"_s);
51 log.WriteValue("variable"_s, runResult.Variable);
52 log.WriteValue("cached"_s, runResult.VariableCached);
53 if (runResult.Stdout) {
54 log.WriteLiteralTextBlock("stdout"_s, *runResult.Stdout);
55 }
56 if (runResult.Stderr) {
57 log.WriteLiteralTextBlock("stderr"_s, *runResult.Stderr);
58 }
59 if (runResult.ExitCode) {
60 try {
61 log.WriteValue("exitCode"_s, std::stoi(*runResult.ExitCode));
62 } catch (std::invalid_argument const&) {
63 log.WriteValue("exitCode"_s, *runResult.ExitCode);
64 }
65 }
66 log.EndObject();
67 log.EndEvent();
68 }
69}
70#endif
71
72class TryRunCommandImpl : public cmCoreTryCompile

Callers 1

TryRunCodeMethod · 0.85

Calls 7

BeginEventMethod · 0.80
WriteValueMethod · 0.80
EndEventMethod · 0.80
BeginObjectMethod · 0.45
WriteLiteralTextBlockMethod · 0.45
EndObjectMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…