Skip to content

Commit e422262

Browse files
committed
sc_version_string: omit the date and time when testing
As analyzed in #359, if the header contains the current time, it will be updated while running the testsuite; this, in turn, causes multiple cmake processes to attempt to update targets like lib/libexpress.so.2.0.0 at the same time, causing test failures.
1 parent 71fe947 commit e422262

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cmake/sc_version_string.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# http://www.cmake.org/pipermail/cmake/2009-February/027014.html
99

1010
set(SC_IS_SUBBUILD "@SC_IS_SUBBUILD@")
11+
set(SC_ENABLE_TESTING "@SC_ENABLE_TESTING@")
1112

1213
set(SC_VERSION_HEADER "${BINARY_DIR}/include/sc_version_string.h")
1314

@@ -47,7 +48,9 @@ string(REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COMMIT_ID})
4748
#once cmake_minimum_required is >= 2.8.11, we can use TIMESTAMP:
4849
#string(TIMESTAMP date_time_string)
4950

50-
if(UNIX)
51+
if(SC_ENABLE_TESTING)
52+
set (date_time_string "NA - disabled for testing")
53+
elseif(UNIX)
5154
execute_process(COMMAND date "+%d %b %Y %H:%M" OUTPUT_VARIABLE date_time_string OUTPUT_STRIP_TRAILING_WHITESPACE)
5255
elseif(WIN32)
5356
execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE currentDate OUTPUT_STRIP_TRAILING_WHITESPACE)

0 commit comments

Comments
 (0)