mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
use WORKING_DIRECTORY to ensure stability of finding the git hash
This commit is contained in:
committed by
Christoffer Lerno
parent
0e44e63fa8
commit
e0afc0f9ea
@@ -4,6 +4,7 @@ set(GIT_HASH "unknown")
|
||||
|
||||
if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/.git")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
OUTPUT_VARIABLE GIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
|
||||
Reference in New Issue
Block a user