Remove non-working git_local_changes, which isn't updated on each rebuild, only when hash changes.
This commit is contained in:
parent
22ce9df352
commit
be18035b5d
@ -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()
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user