]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: use src/liburing for building liburing if it exists 37981/head
authorKefu Chai <kchai@redhat.com>
Mon, 9 Nov 2020 05:11:06 +0000 (13:11 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 9 Nov 2020 05:11:35 +0000 (13:11 +0800)
so we can build with liburing enabled if the dist tarball contains
liburing.

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/Builduring.cmake

index 38ea2388d0d63eb651d2d666a93e1527e3096838..3d28ec82ad2ccc481353774fd02da7c22c692cc8 100644 (file)
@@ -2,13 +2,21 @@ function(build_uring)
   include(FindMake)
   find_make("MAKE_EXECUTABLE" "make_cmd")
 
+  if(EXISTS "${PROJECT_SOURCE_DIR}/src/liburing/configure")
+    set(source_dir_args
+      SOURCE_DIR "${PROJECT_SOURCE_DIR}/src/liburing")
+  else()
+    set(source_dir_args
+      SOURCE_DIR ${CMAKE_BINARY_DIR}/src/liburing
+      GIT_REPOSITORY https://git.kernel.dk/liburing
+      GIT_TAG "liburing-0.7"
+      GIT_SHALLOW TRUE
+      UPDATE_DISCONNECTED TRUE)
+  endif()
+
   include(ExternalProject)
   ExternalProject_Add(liburing_ext
-    GIT_REPOSITORY https://git.kernel.dk/liburing
-    GIT_TAG "liburing-0.7"
-    GIT_SHALLOW TRUE
-    UPDATE_DISCONNECTED TRUE
-    SOURCE_DIR ${CMAKE_BINARY_DIR}/src/liburing
+    ${source_dir_args}
     CONFIGURE_COMMAND <SOURCE_DIR>/configure
     BUILD_COMMAND env CC=${CMAKE_C_COMPILER} ${make_cmd} -C src -s
     BUILD_IN_SOURCE 1