From c43f15d65956d6f40c32c54779414e74bbb62295 Mon Sep 17 00:00:00 2001 From: fef Date: Fri, 9 Jul 2021 00:21:46 +0200 Subject: [PATCH] add jemalloc submodule --- .gitmodules | 3 +++ CMakeLists.txt | 12 ++++++++++++ contrib/jemalloc | 1 + 3 files changed, 16 insertions(+) create mode 100644 .gitmodules create mode 160000 contrib/jemalloc diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e684f0a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "contrib/jemalloc"] + path = contrib/jemalloc + url = https://github.com/jemalloc/jemalloc.git diff --git a/CMakeLists.txt b/CMakeLists.txt index d96aff7..d851902 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,18 @@ endif() find_package(Git QUIET) if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") + option(GIT_SUBMODULE "Check submodules during build" ON) + if(GIT_SUBMODULE) + message(STATUS "Submodule update") + execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE GIT_SUBMOD_RESULT + ) + if(NOT GIT_SUBMOD_RESULT EQUAL "0") + message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") + endif() + endif() + execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE neo_GIT_REVISION diff --git a/contrib/jemalloc b/contrib/jemalloc new file mode 160000 index 0000000..ea6b3e9 --- /dev/null +++ b/contrib/jemalloc @@ -0,0 +1 @@ +Subproject commit ea6b3e973b477b8061e0076bb257dbd7f3faa756