Compare commits
5 commits
master
...
test-paral
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d39fbaf4d7 | ||
|
|
e422262877 | ||
|
|
71fe947ff5 | ||
|
|
beb2a595f1 | ||
|
|
0fbc3c0c84 |
2 changed files with 9 additions and 5 deletions
|
|
@ -80,7 +80,7 @@ std::cout << \"1s is \"<< std::chrono::duration_cast<std::chrono::milliseconds>(
|
|||
set( TEST_NULLPTR "
|
||||
#include <cstddef>
|
||||
std::nullptr_t f() {return nullptr;}
|
||||
int main() {return !!f();}
|
||||
int main() {return !(f() == f());}
|
||||
" )
|
||||
cmake_push_check_state()
|
||||
if( UNIX )
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
# http://www.cmake.org/pipermail/cmake/2009-February/027014.html
|
||||
|
||||
set(SC_IS_SUBBUILD "@SC_IS_SUBBUILD@")
|
||||
set(SC_ENABLE_TESTING "@SC_ENABLE_TESTING@")
|
||||
|
||||
set(SC_VERSION_HEADER "${BINARY_DIR}/include/sc_version_string.h")
|
||||
|
||||
|
|
@ -47,7 +48,9 @@ string(REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COMMIT_ID})
|
|||
#once cmake_minimum_required is >= 2.8.11, we can use TIMESTAMP:
|
||||
#string(TIMESTAMP date_time_string)
|
||||
|
||||
if(UNIX)
|
||||
if(SC_ENABLE_TESTING)
|
||||
set (date_time_string "NA - disabled for testing")
|
||||
elseif(UNIX)
|
||||
execute_process(COMMAND date "+%d %b %Y %H:%M" OUTPUT_VARIABLE date_time_string OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
elseif(WIN32)
|
||||
execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE currentDate OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
|
@ -75,9 +78,10 @@ set(header_string "/* sc_version_string.h - written by cmake. Changes will be lo
|
|||
)
|
||||
|
||||
#don't update the file unless somethig changed
|
||||
file(WRITE ${SC_VERSION_HEADER}.tmp ${header_string})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SC_VERSION_HEADER}.tmp ${SC_VERSION_HEADER})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${SC_VERSION_HEADER}.tmp)
|
||||
string(RANDOM tmpsuffix)
|
||||
file(WRITE ${SC_VERSION_HEADER}.${tmpsuffix} ${header_string})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SC_VERSION_HEADER}.${tmpsuffix} ${SC_VERSION_HEADER})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${SC_VERSION_HEADER}.${tmpsuffix})
|
||||
|
||||
if(NOT SC_IS_SUBBUILD)
|
||||
message("-- sc_version_string.h is up-to-date.")
|
||||
|
|
|
|||
Loading…
Reference in a new issue