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.
| 15 | // otherwise, compiler optmizer will use kSvnInfoCount as 0 at compile time. |
| 16 | // and then generate empty version info. |
| 17 | static 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 | |
| 42 | void SetupBinaryVersion() |
| 43 | { |
no outgoing calls
no test coverage detected