summaryrefslogtreecommitdiff
path: root/storage/rocksdb/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'storage/rocksdb/CMakeLists.txt')
-rw-r--r--storage/rocksdb/CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index 1e20e0fa4a3..6cb7eb1d439 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -220,3 +220,18 @@ IF(MSVC)
# Some checks in C++ runtime that make debug build much slower
ADD_DEFINITIONS(-D_ITERATOR_DEBUG_LEVEL=0)
ENDIF()
+
+IF(GIT_EXECUTABLE)
+ EXECUTE_PROCESS(
+ COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb
+ OUTPUT_VARIABLE OUT RESULT_VARIABLE RES)
+ IF(RES EQUAL 0)
+ STRING(REGEX REPLACE "\n$" "" ROCKSDB_GIT_HASH "${OUT}")
+ ENDIF()
+ENDIF()
+IF(ROCKSDB_GIT_HASH OR
+ (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/rdb_source_revision.h))
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/rdb_source_revision.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/rdb_source_revision.h )
+ENDIF()