| 37 | |
| 38 | #ifndef CMAKE_BOOTSTRAP |
| 39 | void 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 | |
| 72 | class TryRunCommandImpl : public cmCoreTryCompile |
no test coverage detected
searching dependent graphs…