Version.cpp 2.1 KB

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