Version and better logging added.
This commit is contained in:
1 parent
b16c6968ae
commit
77db0b83ab
10 files changed
+326
-8
No files matched your search
@@ -0,0 +1,28 @@
|
||||
# Refresh on every build, including incremental builds after a commit or edit.
|
||||
# configure_file only changes the header when the embedded identity changes.
|
||||
file(READ "${SOURCE_DIR}/VERSION" releaseVersion)
|
||||
string(STRIP "${releaseVersion}" releaseVersion)
|
||||
if(NOT releaseVersion MATCHES "^[0-9][0-9][0-9][0-9][.][0-9][0-9][.][0-9][0-9]$")
|
||||
message(FATAL_ERROR "VERSION must contain a date in YYYY.MM.DD format")
|
||||
endif()
|
||||
set(gitRevision "unavailable")
|
||||
set(gitModified "false")
|
||||
set(buildSuffix "")
|
||||
find_package(Git QUIET)
|
||||
# Do not accidentally identify a source archive as its enclosing repository.
|
||||
if(GIT_FOUND AND EXISTS "${SOURCE_DIR}/.git")
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --short=12 HEAD
|
||||
WORKING_DIRECTORY "${SOURCE_DIR}" RESULT_VARIABLE revisionResult
|
||||
OUTPUT_VARIABLE revision OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" status --porcelain --untracked-files=normal
|
||||
WORKING_DIRECTORY "${SOURCE_DIR}" RESULT_VARIABLE statusResult
|
||||
OUTPUT_VARIABLE status OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
|
||||
if(revisionResult EQUAL 0 AND revision MATCHES "^[0-9a-f]+$")
|
||||
set(gitRevision "${revision}")
|
||||
endif()
|
||||
if(statusResult EQUAL 0 AND NOT status STREQUAL "")
|
||||
set(gitModified "true")
|
||||
set(buildSuffix ", modified")
|
||||
endif()
|
||||
endif()
|
||||
configure_file("${SOURCE_DIR}/cmake/version.h.in" "${OUTPUT_FILE}" @ONLY)
|
||||
@@ -0,0 +1,6 @@
|
||||
// Generated from VERSION and the source checkout; do not edit.
|
||||
#pragma once
|
||||
#define WINE_ACCESS_VERSION "@releaseVersion@"
|
||||
#define WINE_ACCESS_REVISION "@gitRevision@"
|
||||
#define WINE_ACCESS_MODIFIED "@gitModified@"
|
||||
#define WINE_ACCESS_BUILD "Wine Access @releaseVersion@ (@gitRevision@@buildSuffix@)"
|
||||
Reference in new issue
Block a user