aboutsummaryrefslogtreecommitdiff
path: root/cmake/GenerateVersion.cmake
diff options
context:
space:
mode:
authorJan Palus <jpalus@fastmail.com>2022-12-02 13:45:37 +0100
committerGitHub <noreply@github.com>2022-12-02 13:45:37 +0100
commita3f01d32cba903b58e3ab5a353b4dba8c5431f9c (patch)
tree657083412b381d32342ae4afaa5e2db5d6fd005d /cmake/GenerateVersion.cmake
parentc95a0c99592e5bd17c630ea31618026ae6b5ea34 (diff)
downloadrneovim-a3f01d32cba903b58e3ab5a353b4dba8c5431f9c.tar.gz
rneovim-a3f01d32cba903b58e3ab5a353b4dba8c5431f9c.tar.bz2
rneovim-a3f01d32cba903b58e3ab5a353b4dba8c5431f9c.zip
build: restrict `git describe` to top level source directory (#20993)
fix version determination when building neovim from release tarball extracted within another git repository
Diffstat (limited to 'cmake/GenerateVersion.cmake')
-rw-r--r--cmake/GenerateVersion.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/GenerateVersion.cmake b/cmake/GenerateVersion.cmake
index 7ce6ee430e..8cea39e4de 100644
--- a/cmake/GenerateVersion.cmake
+++ b/cmake/GenerateVersion.cmake
@@ -2,7 +2,7 @@ set(NVIM_VERSION
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}${NVIM_VERSION_PRERELEASE}")
execute_process(
- COMMAND git describe --first-parent --dirty --always
+ COMMAND git --git-dir=${NVIM_SOURCE_DIR}/.git --work-tree=${NVIM_SOURCE_DIR} describe --first-parent --dirty --always
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE RES)