summaryrefslogtreecommitdiffstats
path: root/CMakeModules
diff options
context:
space:
mode:
authorAndrew Udvare <audvare@gmail.com>2021-12-21 01:13:07 +0100
committerAndrew Udvare <audvare@gmail.com>2021-12-21 01:13:07 +0100
commitcaf38725ae2802bdc71ea45c40c34635c5090dca (patch)
treeb15631de010afdacdab9ac503be4b5fd9ffa41d7 /CMakeModules
parentMerge pull request #7532 from goldenx86/patch-3 (diff)
downloadyuzu-caf38725ae2802bdc71ea45c40c34635c5090dca.tar
yuzu-caf38725ae2802bdc71ea45c40c34635c5090dca.tar.gz
yuzu-caf38725ae2802bdc71ea45c40c34635c5090dca.tar.bz2
yuzu-caf38725ae2802bdc71ea45c40c34635c5090dca.tar.lz
yuzu-caf38725ae2802bdc71ea45c40c34635c5090dca.tar.xz
yuzu-caf38725ae2802bdc71ea45c40c34635c5090dca.tar.zst
yuzu-caf38725ae2802bdc71ea45c40c34635c5090dca.zip
Diffstat (limited to 'CMakeModules')
-rw-r--r--CMakeModules/GenerateSCMRev.cmake12
1 files changed, 9 insertions, 3 deletions
diff --git a/CMakeModules/GenerateSCMRev.cmake b/CMakeModules/GenerateSCMRev.cmake
index 43ca730ec..c7da2b91d 100644
--- a/CMakeModules/GenerateSCMRev.cmake
+++ b/CMakeModules/GenerateSCMRev.cmake
@@ -11,9 +11,15 @@ find_package(Git QUIET PATHS "${GIT_EXECUTABLE}")
# generate git/build information
include(GetGitRevisionDescription)
-get_git_head_revision(GIT_REF_SPEC GIT_REV)
-git_describe(GIT_DESC --always --long --dirty)
-git_branch_name(GIT_BRANCH)
+if(NOT GIT_REF_SPEC)
+ get_git_head_revision(GIT_REF_SPEC GIT_REV)
+endif()
+if(NOT GIT_DESC)
+ git_describe(GIT_DESC --always --long --dirty)
+endif()
+if (NOT GIT_BRANCH)
+ git_branch_name(GIT_BRANCH)
+endif()
get_timestamp(BUILD_DATE)
# Generate cpp with Git revision from template