| 1 | // Copyright 2008 Dolphin Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #include "Common/Version.h" |
| 5 | |
| 6 | #include <string> |
| 7 | |
| 8 | #include "Common/scmrev.h" |
| 9 | |
| 10 | namespace Common |
| 11 | { |
| 12 | #define EMULATOR_NAME "Dolphin" |
| 13 | |
| 14 | #ifdef _DEBUG |
| 15 | #define BUILD_TYPE_STR "Debug " |
| 16 | #elif defined DEBUGFAST |
| 17 | #define BUILD_TYPE_STR "DebugFast " |
| 18 | #else |
| 19 | #define BUILD_TYPE_STR "" |
| 20 | #endif |
| 21 | |
| 22 | const std::string& GetEmulatorName() |
| 23 | { |
| 24 | static const std::string emulator_name = EMULATOR_NAME; |
| 25 | return emulator_name; |
| 26 | } |
| 27 | |
| 28 | const std::string& GetScmRevStr() |
| 29 | { |
| 30 | static const std::string scm_rev_str = EMULATOR_NAME " " |
| 31 | // Note this macro can be empty if the master branch does not exist. |
| 32 | #if 1 - SCM_COMMITS_AHEAD_MASTER - 1 != 0 |
| 33 | "[" SCM_BRANCH_STR "] " |
| 34 | #endif |
| 35 | |
| 36 | #ifdef __INTEL_COMPILER |
| 37 | BUILD_TYPE_STR SCM_DESC_STR "-ICC"; |
| 38 | #else |
| 39 | BUILD_TYPE_STR SCM_DESC_STR; |
| 40 | #endif |
| 41 | return scm_rev_str; |
| 42 | } |
| 43 | |
| 44 | const std::string& GetScmRevGitStr() |
| 45 | { |
| 46 | static const std::string scm_rev_git_str = SCM_REV_STR; |
| 47 | return scm_rev_git_str; |
| 48 | } |
| 49 | |
| 50 | const std::string& GetScmDescStr() |
| 51 | { |
| 52 | static const std::string scm_desc_str = SCM_DESC_STR; |
| 53 | return scm_desc_str; |
| 54 | } |
| 55 | |
| 56 | const std::string& GetScmBranchStr() |
| 57 | { |
| 58 | static const std::string scm_branch_str = SCM_BRANCH_STR; |
| 59 | return scm_branch_str; |
| 60 | } |
| 61 | |
| 62 | const std::string& GetUserAgentStr() |
| 63 | { |
| 64 | static const std::string user_agent_str = EMULATOR_NAME "/" SCM_DESC_STR; |
| 65 | return user_agent_str; |
| 66 | } |
| 67 | |
| 68 | const std::string& GetScmDistributorStr() |
| 69 | { |
| 70 | static const std::string scm_distributor_str = SCM_DISTRIBUTOR_STR; |
| 71 | return scm_distributor_str; |
| 72 | } |
| 73 | |
| 74 | const std::string& GetScmUpdateTrackStr() |
| 75 | { |
| 76 | static const std::string scm_update_track_str = SCM_UPDATE_TRACK_STR; |
| 77 | return scm_update_track_str; |
| 78 | } |
| 79 | |
| 80 | const std::string& GetNetplayDolphinVer() |
| 81 | { |
| 82 | #ifdef _WIN32 |
| 83 | static const std::string netplay_dolphin_ver = SCM_DESC_STR " Win"; |
| 84 | #elif __APPLE__ |
| 85 | static const std::string netplay_dolphin_ver = SCM_DESC_STR " Mac"; |
| 86 | #else |
| 87 | static const std::string netplay_dolphin_ver = SCM_DESC_STR " Lin"; |
| 88 | #endif |
| 89 | return netplay_dolphin_ver; |
| 90 | } |
| 91 | |
| 92 | int GetScmCommitsAheadMaster() |
| 93 | { |
| 94 | // Note this macro can be empty if the master branch does not exist. |
| 95 | return SCM_COMMITS_AHEAD_MASTER + 0; |
| 96 | } |
| 97 | |
| 98 | } // namespace Common |