MCPcopy Create free account
hub / github.com/chen3feng/toft / MakeVersionInfo

Function MakeVersionInfo

base/setup_binary_version.cpp:17–40  ·  view source on GitHub ↗

This function can't be in binary_version.cpp, otherwise, compiler optmizer will use kSvnInfoCount as 0 at compile time. and then generate empty version info.

Source from the content-addressed store, hash-verified

15// otherwise, compiler optmizer will use kSvnInfoCount as 0 at compile time.
16// and then generate empty version info.
17static std::string MakeVersionInfo()
18{
19 using namespace binary_version;
20
21 std::ostringstream oss;
22 oss << "\n"; // Open a new line in gflags --version output.
23
24 if (kSvnInfoCount > 0)
25 {
26 oss << "Sources:\n"
27 << "----------------------------------------------------------\n";
28 for (int i = 0; i < kSvnInfoCount; ++i)
29 oss << kSvnInfo[i];
30 oss << "----------------------------------------------------------\n";
31 }
32
33 oss << "BuildTime: " << kBuildTime << "\n"
34 << "BuildType: " << kBuildType << "\n"
35 << "BuilderName: " << kBuilderName << "\n"
36 << "HostName: " << kHostName << "\n"
37 << "Compiler: " << kCompiler << "\n";
38
39 return oss.str();
40}
41
42void SetupBinaryVersion()
43{

Callers 1

SetupBinaryVersionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected