diff --git a/cmake/cmake.options b/cmake/cmake.options index 8eec896af1ec910936a800cb294ae26ae0fed199..44fa8c7e4b13bed3cf75a07c66c79054a0c253d0 100644 --- a/cmake/cmake.options +++ b/cmake/cmake.options @@ -44,6 +44,12 @@ option( OFF ) +option( + BUILD_WITH_UV + "If build with libuv" + OFF +) + option( BUILD_WITH_CRAFT "If build with canonical-raft" diff --git a/cmake/libuv_CMakeLists.txt.in b/cmake/libuv_CMakeLists.txt.in new file mode 100644 index 0000000000000000000000000000000000000000..ed406e089e0f641f0a87c1a80fd5a501acbaf490 --- /dev/null +++ b/cmake/libuv_CMakeLists.txt.in @@ -0,0 +1,12 @@ + +# libuv +ExternalProject_Add(libuv + GIT_REPOSITORY https://github.com/libuv/libuv.git + GIT_TAG v1.42.0 + SOURCE_DIR "${CMAKE_CONTRIB_DIR}/libuv" + BINARY_DIR "" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) \ No newline at end of file diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index fa3bff41ae81729f7ad58b0a6c64d3ca5868e74c..041727b0f723996a37d321dc12bffaf5d159ce2e 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -37,8 +37,14 @@ endif(${BUILD_WITH_ROCKSDB}) # canonical-raft if(${BUILD_WITH_CRAFT}) cat("${CMAKE_SUPPORT_DIR}/craft_CMakeLists.txt.in" ${CONTRIB_TMP_FILE}) + option(BUILD_WITH_UV "" ON) endif(${BUILD_WITH_CRAFT}) +#libuv +if(${BUILD_WITH_UV}) + cat("${CMAKE_SUPPORT_DIR}/libuv_CMakeLists.txt.in" ${CONTRIB_TMP_FILE}) +endif(${BUILD_WITH_UV}) + # bdb if(${BUILD_WITH_BDB}) cat("${CMAKE_SUPPORT_DIR}/bdb_CMakeLists.txt.in" ${CONTRIB_TMP_FILE}) @@ -161,6 +167,11 @@ if(${BUILD_WITH_CRAFT}) # ) endif(${BUILD_WITH_CRAFT}) +# LIBUV +if(${BUILD_WITH_UV}) + add_subdirectory(libuv) +endif(${BUILD_WITH_UV}) + # BDB if(${BUILD_WITH_BDB}) add_library(bdb STATIC IMPORTED GLOBAL) diff --git a/contrib/test/craft/CMakeLists.txt b/contrib/test/craft/CMakeLists.txt index a6659b351821e1bfca124bdb51e9b2d8bda016c1..e0f6ae64bd3e9c998db15c1006cebf1b15702f5b 100644 --- a/contrib/test/craft/CMakeLists.txt +++ b/contrib/test/craft/CMakeLists.txt @@ -1,2 +1,2 @@ add_executable(simulate_vnode "simulate_vnode.c") -target_link_libraries(simulate_vnode PUBLIC craft lz4) \ No newline at end of file +target_link_libraries(simulate_vnode PUBLIC craft lz4 uv_a) \ No newline at end of file