mdbx-make: использование VERSION.json с полной информацией вместо однострочного текстового файла.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2024-11-12 17:49:21 +03:00
parent ab4bf2d7f0
commit f550c65476
2 changed files with 5 additions and 6 deletions

View File

@ -167,7 +167,7 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git" AND
message(SEND_ERROR "Git command-line tool not found")
endif()
set(MDBX_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" AND
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.json" AND
EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" AND
EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/NOTICE" AND
EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx.c" AND
@ -1180,7 +1180,6 @@ if (NOT SUBPROJECT)
set(CPACK_PACKAGE_VERSION_COMMIT ${MDBX_VERSION_REVISION})
set(PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.${CPACK_PACKAGE_VERSION_COMMIT}")
message(STATUS "libmdbx package version is ${PACKAGE_VERSION}")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/VERSION.txt" "${MDBX_VERSION_MAJOR}.${MDBX_VERSION_MINOR}.${MDBX_VERSION_RELEASE}.${MDBX_VERSION_REVISION}")
endif()
cmake_policy(POP)

View File

@ -353,7 +353,7 @@ define uname2titer
esac
endef
DIST_EXTRA := LICENSE NOTICE README.md CMakeLists.txt GNUmakefile Makefile ChangeLog.md VERSION.txt config.h.in ntdll.def \
DIST_EXTRA := LICENSE NOTICE README.md CMakeLists.txt GNUmakefile Makefile ChangeLog.md VERSION.json config.h.in ntdll.def \
$(addprefix man1/, $(MANPAGES)) cmake/compiler.cmake cmake/profile.cmake cmake/utils.cmake
DIST_SRC := mdbx.h mdbx.h++ mdbx.c mdbx.c++ $(addsuffix .c, $(MDBX_TOOLS))
@ -733,11 +733,11 @@ dist/$(1): $(1) src/version.c $(lastword $(MAKEFILE_LIST))
$(QUIET)mkdir -p $$(dir $$@) && sed -e '/^#> dist-cutoff-begin/,/^#< dist-cutoff-end/d' $$< >$$@
endef
$(foreach file,mdbx.h mdbx.h++ $(filter-out man1/% VERSION.txt %.in ntdll.def,$(DIST_EXTRA)),$(eval $(call dist-extra-rule,$(file))))
$(foreach file,mdbx.h mdbx.h++ $(filter-out man1/% VERSION.json %.in ntdll.def,$(DIST_EXTRA)),$(eval $(call dist-extra-rule,$(file))))
dist/VERSION.txt: src/version.c
dist/VERSION.json: src/version.c
@echo ' MAKE $@'
$(QUIET)mkdir -p dist/ && echo "$(MDBX_GIT_VERSION).$(MDBX_GIT_REVISION)" >$@
$(QUIET)mkdir -p dist/ && echo "{ \"git_describe\": \"$(MDBX_GIT_DESCRIBE)\", \"git_timestamp\": \"$(MDBX_GIT_TIMESTAMP)\", \"git_tree\": \"$(shell git show --no-patch --format=%T HEAD 2>&1)\", \"git_commit\": \"$(shell git show --no-patch --format=%H HEAD 2>&1)\", \"version_4dot\": \"$(MDBX_GIT_VERSION).$(MDBX_GIT_REVISION)\" }" >$@
dist/ntdll.def: src/ntdll.def
@echo ' COPY $@'