summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Rowe <jroweboy@gmail.com>2020-01-16 08:12:50 +0100
committerJames Rowe <jroweboy@gmail.com>2020-01-16 08:12:50 +0100
commitb429095b615918eca05a4a586d5974f8f07a9bda (patch)
tree886130420a22ae13106179ed4c25bb02ce260701
parentMerge pull request #3303 from lioncash/reorder (diff)
downloadyuzu-b429095b615918eca05a4a586d5974f8f07a9bda.tar
yuzu-b429095b615918eca05a4a586d5974f8f07a9bda.tar.gz
yuzu-b429095b615918eca05a4a586d5974f8f07a9bda.tar.bz2
yuzu-b429095b615918eca05a4a586d5974f8f07a9bda.tar.lz
yuzu-b429095b615918eca05a4a586d5974f8f07a9bda.tar.xz
yuzu-b429095b615918eca05a4a586d5974f8f07a9bda.tar.zst
yuzu-b429095b615918eca05a4a586d5974f8f07a9bda.zip
-rw-r--r--CMakeModules/GenerateSCMRev.cmake4
-rw-r--r--src/common/CMakeLists.txt5
2 files changed, 9 insertions, 0 deletions
diff --git a/CMakeModules/GenerateSCMRev.cmake b/CMakeModules/GenerateSCMRev.cmake
index 21e03ae98..fa7ae835f 100644
--- a/CMakeModules/GenerateSCMRev.cmake
+++ b/CMakeModules/GenerateSCMRev.cmake
@@ -5,6 +5,10 @@ function(get_timestamp _var)
endfunction()
list(APPEND CMAKE_MODULE_PATH "${SRC_DIR}/externals/cmake-modules")
+
+# Find the package here with the known path so that the GetGit commands can find it as well
+find_package(Git QUIET PATHS "${GIT_EXECUTABLE}")
+
# generate git/build information
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REF_SPEC GIT_REV)
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 9b0c3db68..9afc6105d 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -15,6 +15,10 @@ endif ()
if (DEFINED ENV{DISPLAYVERSION})
set(DISPLAY_VERSION $ENV{DISPLAYVERSION})
endif ()
+
+# Pass the path to git to the GenerateSCMRev.cmake as well
+find_package(Git QUIET)
+
add_custom_command(OUTPUT scm_rev.cpp
COMMAND ${CMAKE_COMMAND}
-DSRC_DIR="${CMAKE_SOURCE_DIR}"
@@ -23,6 +27,7 @@ add_custom_command(OUTPUT scm_rev.cpp
-DTITLE_BAR_FORMAT_RUNNING="${TITLE_BAR_FORMAT_RUNNING}"
-DBUILD_TAG="${BUILD_TAG}"
-DBUILD_ID="${DISPLAY_VERSION}"
+ -DGIT_EXECUTABLE="${GIT_EXECUTABLE}"
-P "${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake"
DEPENDS
# WARNING! It was too much work to try and make a common location for this list,