diff options
| author | 2017-08-01 19:54:24 -0400 | |
|---|---|---|
| committer | 2017-08-03 20:10:37 -0400 | |
| commit | f44a1e0291ab64ea9f34a9263432f30d18f3e98d (patch) | |
| tree | 985c56c99da9edd301e96bf27551de33a805a629 | |
| parent | core: Expose AppLoader as a public interface. (diff) | |
| download | yuzu-f44a1e0291ab64ea9f34a9263432f30d18f3e98d.tar.gz yuzu-f44a1e0291ab64ea9f34a9263432f30d18f3e98d.tar.xz yuzu-f44a1e0291ab64ea9f34a9263432f30d18f3e98d.zip | |
common: Add build timestamp to scm_rev.
| -rw-r--r-- | CMakeLists.txt | 9 | ||||
| -rw-r--r-- | src/common/scm_rev.cpp.in | 2 | ||||
| -rw-r--r-- | src/common/scm_rev.h | 1 |
3 files changed, 11 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 79d8046d9..ddba04ef9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -295,11 +295,18 @@ function(create_directory_groups) | |||
| 295 | endforeach() | 295 | endforeach() |
| 296 | endfunction() | 296 | endfunction() |
| 297 | 297 | ||
| 298 | # generate git revision information | 298 | # Gets a UTC timstamp and sets the provided variable to it |
| 299 | function(get_timestamp _var) | ||
| 300 | string(TIMESTAMP timestamp UTC) | ||
| 301 | set(${_var} "${timestamp}" PARENT_SCOPE) | ||
| 302 | endfunction() | ||
| 303 | |||
| 304 | # generate git/build information | ||
| 299 | include(GetGitRevisionDescription) | 305 | include(GetGitRevisionDescription) |
| 300 | get_git_head_revision(GIT_REF_SPEC GIT_REV) | 306 | get_git_head_revision(GIT_REF_SPEC GIT_REV) |
| 301 | git_describe(GIT_DESC --always --long --dirty) | 307 | git_describe(GIT_DESC --always --long --dirty) |
| 302 | git_branch_name(GIT_BRANCH) | 308 | git_branch_name(GIT_BRANCH) |
| 309 | get_timestamp(BUILD_DATE) | ||
| 303 | 310 | ||
| 304 | enable_testing() | 311 | enable_testing() |
| 305 | add_subdirectory(externals) | 312 | add_subdirectory(externals) |
diff --git a/src/common/scm_rev.cpp.in b/src/common/scm_rev.cpp.in index 0080db5d5..4083095d5 100644 --- a/src/common/scm_rev.cpp.in +++ b/src/common/scm_rev.cpp.in | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #define GIT_BRANCH "@GIT_BRANCH@" | 8 | #define GIT_BRANCH "@GIT_BRANCH@" |
| 9 | #define GIT_DESC "@GIT_DESC@" | 9 | #define GIT_DESC "@GIT_DESC@" |
| 10 | #define BUILD_NAME "@REPO_NAME@" | 10 | #define BUILD_NAME "@REPO_NAME@" |
| 11 | #define BUILD_DATE "@BUILD_DATE@" | ||
| 11 | 12 | ||
| 12 | namespace Common { | 13 | namespace Common { |
| 13 | 14 | ||
| @@ -15,6 +16,7 @@ const char g_scm_rev[] = GIT_REV; | |||
| 15 | const char g_scm_branch[] = GIT_BRANCH; | 16 | const char g_scm_branch[] = GIT_BRANCH; |
| 16 | const char g_scm_desc[] = GIT_DESC; | 17 | const char g_scm_desc[] = GIT_DESC; |
| 17 | const char g_build_name[] = BUILD_NAME; | 18 | const char g_build_name[] = BUILD_NAME; |
| 19 | const char g_build_date[] = BUILD_DATE; | ||
| 18 | 20 | ||
| 19 | } // namespace | 21 | } // namespace |
| 20 | 22 | ||
diff --git a/src/common/scm_rev.h b/src/common/scm_rev.h index e22389803..18aaa1735 100644 --- a/src/common/scm_rev.h +++ b/src/common/scm_rev.h | |||
| @@ -10,5 +10,6 @@ extern const char g_scm_rev[]; | |||
| 10 | extern const char g_scm_branch[]; | 10 | extern const char g_scm_branch[]; |
| 11 | extern const char g_scm_desc[]; | 11 | extern const char g_scm_desc[]; |
| 12 | extern const char g_build_name[]; | 12 | extern const char g_build_name[]; |
| 13 | extern const char g_build_date[]; | ||
| 13 | 14 | ||
| 14 | } // namespace | 15 | } // namespace |