mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
feat: report "build" in vim.version() #23925
Problem: Nvim version string typically has a "build" component but vim.version() doesn't report it. Solution: Add the "build" field to vim.version(). Closes #23863
This commit is contained in:
@ -14,6 +14,9 @@ if(RES)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Extract build info: "v0.9.0-145-g0f9113907" => "g0f9113907"
|
||||
string(REGEX REPLACE ".*\\-" "" NVIM_VERSION_BUILD "${GIT_TAG}")
|
||||
|
||||
# `git describe` annotates the most recent tagged release; for pre-release
|
||||
# builds we append that to the dev version.
|
||||
if(NVIM_VERSION_PRERELEASE)
|
||||
@ -24,7 +27,7 @@ if(NVIM_VERSION_PRERELEASE)
|
||||
set(NVIM_VERSION "${NVIM_VERSION}-${NVIM_VERSION_GIT}")
|
||||
endif()
|
||||
|
||||
set(NVIM_VERSION_STRING "#define NVIM_VERSION_MEDIUM \"${NVIM_VERSION}\"\n")
|
||||
set(NVIM_VERSION_STRING "#define NVIM_VERSION_MEDIUM \"${NVIM_VERSION}\"\n#define NVIM_VERSION_BUILD \"${NVIM_VERSION_BUILD}\"\n")
|
||||
|
||||
string(SHA1 CURRENT_VERSION_HASH "${NVIM_VERSION_STRING}")
|
||||
if(EXISTS ${OUTPUT})
|
||||
|
Reference in New Issue
Block a user