Skip to content

Commit 52f5670

Browse files
committed
Tweak format to match swift --version more closely
1 parent bfbc74b commit 52f5670

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmake/modules/LibraryVersion.cmake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88

99
# The current version of the Swift Testing release. For release branches,
1010
# remember to remove -dev.
11-
set(SWT_TESTING_LIBRARY_VERSION "6.1.0-dev")
11+
set(SWT_TESTING_LIBRARY_VERSION "6.1-dev")
1212

1313
find_package(Git QUIET)
1414
if(Git_FOUND)
15-
# Look for a tag (including non-annotated, i.e. commit-specific, ones.)
15+
# Get the commit hash corresponding to the current build. Limit length to 15
16+
# to match `swift --version` output format.
1617
execute_process(
17-
COMMAND ${GIT_EXECUTABLE} describe --tags
18+
COMMAND ${GIT_EXECUTABLE} rev-parse --short=15 --verify HEAD
1819
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
1920
OUTPUT_VARIABLE GIT_VERSION
2021
OUTPUT_STRIP_TRAILING_WHITESPACE

0 commit comments

Comments
 (0)