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

Method PrintTraceFormatVersion

Source/cmake.cxx:1815–1855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1813}
1814
1815void cmake::PrintTraceFormatVersion()
1816{
1817 if (!this->GetTrace()) {
1818 return;
1819 }
1820
1821 std::string msg;
1822
1823 switch (this->GetTraceFormat()) {
1824 case TraceFormat::JSONv1: {
1825#ifndef CMAKE_BOOTSTRAP
1826 Json::Value val;
1827 Json::Value version;
1828 Json::StreamWriterBuilder builder;
1829 builder["indentation"] = "";
1830 version["major"] = 1;
1831 version["minor"] = 2;
1832 val["version"] = version;
1833 msg = Json::writeString(builder, val);
1834#endif
1835 break;
1836 }
1837 case TraceFormat::Human:
1838 msg = "";
1839 break;
1840 case TraceFormat::Undefined:
1841 msg = "INTERNAL ERROR: Trace format is Undefined";
1842 break;
1843 }
1844
1845 if (msg.empty()) {
1846 return;
1847 }
1848
1849 auto& f = this->GetTraceFile();
1850 if (f) {
1851 f << msg << '\n';
1852 } else {
1853 cmSystemTools::Message(msg);
1854 }
1855}
1856
1857void cmake::SetTraceRedirect(cmake* other)
1858{

Callers 1

RunMethod · 0.95

Calls 5

GetTraceMethod · 0.95
GetTraceFormatMethod · 0.95
writeStringFunction · 0.85
MessageClass · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected