build(Windows): fix redoing version generation (#21880)

Problem: On Windows, neovim's version is generated every time nvim is
built, even if code hasn't been changed.  That is because version
generation is done based on a hash matching of a file and the content of
the file.  And in Windows they don't match, because of the DOS
line-endings.

Solution: Write the file containing nvim version with UNIX line-endings.
This commit is contained in:
Enan Ajmain 2023-01-18 16:48:01 +06:00 committed by GitHub
parent 36555730da
commit 7f7b83baef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,4 +33,7 @@ endif()
if(NOT "${NVIM_VERSION_HASH}" STREQUAL "${CURRENT_VERSION_HASH}")
message(STATUS "Using NVIM_VERSION: ${NVIM_VERSION}")
file(WRITE "${OUTPUT}" "${NVIM_VERSION_STRING}")
if(WIN32)
configure_file("${OUTPUT}" "${OUTPUT}" NEWLINE_STYLE UNIX)
endif()
endif()