Remove non-working git_local_changes, which isn't updated on each rebuild, only when hash changes.

This commit is contained in:
levlam 2022-07-10 18:20:23 +03:00
parent 22ce9df352
commit be18035b5d
2 changed files with 1 additions and 32 deletions

View File

@ -138,30 +138,3 @@ function(get_git_head_revision _refspecvar _hashvar)
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
endfunction()
function(git_local_changes _var)
if (NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if (NOT GIT_FOUND)
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()
if (NOT hash)
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
return()
endif()
execute_process(
COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD --
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE res
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if (res EQUAL 0)
set(${_var} "CLEAN" PARENT_SCOPE)
else()
set(${_var} "DIRTY" PARENT_SCOPE)
endif()
endfunction()

View File

@ -154,11 +154,7 @@ endif()
include(GetGitRevisionDescription)
get_git_head_revision(TD_GIT_REFSPEC TD_GIT_COMMIT)
git_local_changes(TD_GIT_DIRTY)
message(STATUS "Git state: ${TD_GIT_COMMIT} ${TD_GIT_DIRTY}")
if (NOT TD_GIT_DIRTY STREQUAL "DIRTY")
unset(TD_GIT_DIRTY)
endif()
message(STATUS "Git state: ${TD_GIT_COMMIT}")
add_subdirectory(tdtl)