summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2017-08-01 19:54:24 -0400
committerGravatar bunnei2017-08-03 20:10:37 -0400
commitf44a1e0291ab64ea9f34a9263432f30d18f3e98d (patch)
tree985c56c99da9edd301e96bf27551de33a805a629
parentcore: Expose AppLoader as a public interface. (diff)
downloadyuzu-f44a1e0291ab64ea9f34a9263432f30d18f3e98d.tar.gz
yuzu-f44a1e0291ab64ea9f34a9263432f30d18f3e98d.tar.xz
yuzu-f44a1e0291ab64ea9f34a9263432f30d18f3e98d.zip
common: Add build timestamp to scm_rev.
-rw-r--r--CMakeLists.txt9
-rw-r--r--src/common/scm_rev.cpp.in2
-rw-r--r--src/common/scm_rev.h1
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()
296endfunction() 296endfunction()
297 297
298# generate git revision information 298# Gets a UTC timstamp and sets the provided variable to it
299function(get_timestamp _var)
300 string(TIMESTAMP timestamp UTC)
301 set(${_var} "${timestamp}" PARENT_SCOPE)
302endfunction()
303
304# generate git/build information
299include(GetGitRevisionDescription) 305include(GetGitRevisionDescription)
300get_git_head_revision(GIT_REF_SPEC GIT_REV) 306get_git_head_revision(GIT_REF_SPEC GIT_REV)
301git_describe(GIT_DESC --always --long --dirty) 307git_describe(GIT_DESC --always --long --dirty)
302git_branch_name(GIT_BRANCH) 308git_branch_name(GIT_BRANCH)
309get_timestamp(BUILD_DATE)
303 310
304enable_testing() 311enable_testing()
305add_subdirectory(externals) 312add_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
12namespace Common { 13namespace Common {
13 14
@@ -15,6 +16,7 @@ const char g_scm_rev[] = GIT_REV;
15const char g_scm_branch[] = GIT_BRANCH; 16const char g_scm_branch[] = GIT_BRANCH;
16const char g_scm_desc[] = GIT_DESC; 17const char g_scm_desc[] = GIT_DESC;
17const char g_build_name[] = BUILD_NAME; 18const char g_build_name[] = BUILD_NAME;
19const 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[];
10extern const char g_scm_branch[]; 10extern const char g_scm_branch[];
11extern const char g_scm_desc[]; 11extern const char g_scm_desc[];
12extern const char g_build_name[]; 12extern const char g_build_name[];
13extern const char g_build_date[];
13 14
14} // namespace 15} // namespace