diff options
| author | swurl <swurl@swurl.xyz> | 2025-06-05 18:58:54 +0000 |
|---|---|---|
| committer | crueter <crueter@noreply.localhost> | 2025-06-05 18:58:54 +0000 |
| commit | 7e13da47af71814d612c6c060be68e8ba84271ff (patch) | |
| tree | 52e8a7b5229d11a8d3c583d74cf3ff6126f363b8 /CMakeModules/GenerateSCMRev.cmake | |
| parent | d2364ae1f7f6ea962d296148d85fe08549baed37 (diff) | |
Fix build ID and update checker (#148)
Signed-off-by: swurl <swurl@swurl.xyz>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/148
Co-authored-by: swurl <swurl@swurl.xyz>
Co-committed-by: swurl <swurl@swurl.xyz>
Diffstat (limited to 'CMakeModules/GenerateSCMRev.cmake')
| -rw-r--r-- | CMakeModules/GenerateSCMRev.cmake | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/CMakeModules/GenerateSCMRev.cmake b/CMakeModules/GenerateSCMRev.cmake index 1d4aa979d3..55be49cb98 100644 --- a/CMakeModules/GenerateSCMRev.cmake +++ b/CMakeModules/GenerateSCMRev.cmake @@ -20,37 +20,19 @@ if (NOT GIT_BRANCH) endif() get_timestamp(BUILD_DATE) +git_get_exact_tag(GIT_TAG --tags) +if (GIT_TAG MATCHES "NOTFOUND") + set(BUILD_VERSION "${GIT_DESC}") + set(IS_DEV_BUILD true) +else() + set(BUILD_VERSION ${GIT_TAG}) + set(IS_DEV_BUILD false) +endif() + # Generate cpp with Git revision from template # Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well -set(REPO_NAME "") -set(BUILD_VERSION "0") -set(BUILD_ID ${DISPLAY_VERSION}) -if (BUILD_REPOSITORY) - # regex capture the string nightly or canary into CMAKE_MATCH_1 - string(REGEX MATCH "yuzu-emu/yuzu-?(.*)" OUTVAR ${BUILD_REPOSITORY}) - if ("${CMAKE_MATCH_COUNT}" GREATER 0) - # capitalize the first letter of each word in the repo name. - string(REPLACE "-" ";" REPO_NAME_LIST ${CMAKE_MATCH_1}) - foreach(WORD ${REPO_NAME_LIST}) - string(SUBSTRING ${WORD} 0 1 FIRST_LETTER) - string(SUBSTRING ${WORD} 1 -1 REMAINDER) - string(TOUPPER ${FIRST_LETTER} FIRST_LETTER) - set(REPO_NAME "${REPO_NAME}${FIRST_LETTER}${REMAINDER}") - endforeach() - if (BUILD_TAG) - string(REGEX MATCH "${CMAKE_MATCH_1}-([0-9]+)" OUTVAR ${BUILD_TAG}) - if (${CMAKE_MATCH_COUNT} GREATER 0) - set(BUILD_VERSION ${CMAKE_MATCH_1}) - endif() - if (BUILD_VERSION) - # This leaves a trailing space on the last word, but we actually want that - # because of how it's styled in the title bar. - set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_VERSION} ") - else() - set(BUILD_FULLNAME "") - endif() - endif() - endif() -endif() +set(REPO_NAME "eden") +set(BUILD_ID ${GIT_BRANCH}) +set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_VERSION} ") configure_file(scm_rev.cpp.in scm_rev.cpp @ONLY) |
