VERY experimental Nintendo Switch 2 emulator
C++
cmake: fix git detection
Alexandre Bouvier8a1d99e72dd6
diff --git a/CMakeModules/GenerateSCMRev.cmake b/CMakeModules/GenerateSCMRev.cmakeindex 0e4bd121c4..2cdb9189ad 100644--- a/CMakeModules/GenerateSCMRev.cmake+++ b/CMakeModules/GenerateSCMRev.cmake@@ -7,11 +7,6 @@ function(get_timestamp _var)set(${_var} "${timestamp}" PARENT_SCOPE)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 informationinclude(GetGitRevisionDescription)if(NOT GIT_REF_SPEC)@@ -29,6 +24,7 @@ get_timestamp(BUILD_DATE)# Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as wellset(REPO_NAME "")set(BUILD_VERSION "0")+set(BUILD_ID ${DISPLAY_VERSION})if (BUILD_REPOSITORY)# regex capture the string nightly or canary into CMAKE_MATCH_1string(REGEX MATCH "yuzu-emu/yuzu-?(.*)" OUTVAR ${BUILD_REPOSITORY})@@ -57,6 +53,4 @@ if (BUILD_REPOSITORY)endif()endif()-# The variable SRC_DIR must be passed into the script-# (since it uses the current build directory for all values of CMAKE_*_DIR)-configure_file("${SRC_DIR}/src/common/scm_rev.cpp.in" "scm_rev.cpp" @ONLY)+configure_file(scm_rev.cpp.in scm_rev.cpp @ONLY)diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txtindex 68436a4bcf..3447fabd8f 100644--- a/src/common/CMakeLists.txt+++ b/src/common/CMakeLists.txt@@ -14,32 +14,7 @@ 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=${PROJECT_SOURCE_DIR}- -DBUILD_REPOSITORY=${BUILD_REPOSITORY}- -DTITLE_BAR_FORMAT_IDLE=${TITLE_BAR_FORMAT_IDLE}- -DTITLE_BAR_FORMAT_RUNNING=${TITLE_BAR_FORMAT_RUNNING}- -DBUILD_TAG=${BUILD_TAG}- -DBUILD_ID=${DISPLAY_VERSION}- -DGIT_REF_SPEC=${GIT_REF_SPEC}- -DGIT_REV=${GIT_REV}- -DGIT_DESC=${GIT_DESC}- -DGIT_BRANCH=${GIT_BRANCH}- -DBUILD_FULLNAME=${BUILD_FULLNAME}- -DGIT_EXECUTABLE=${GIT_EXECUTABLE}- -P ${PROJECT_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake- DEPENDS- # Check that the scm_rev files haven't changed- "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in"- "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.h"- # technically we should regenerate if the git version changed, but its not worth the effort imo- "${PROJECT_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake"- VERBATIM-)+include(GenerateSCMRev)add_library(common STATICalgorithm.h@@ -117,7 +92,7 @@ add_library(common STATICquaternion.hreader_writer_queue.hring_buffer.h- scm_rev.cpp+ ${CMAKE_CURRENT_BINARY_DIR}/scm_rev.cppscm_rev.hscope_exit.hsettings.cpp