]> git.proxmox.com Git - ceph.git/blobdiff - ceph/cmake/modules/BuildSPDK.cmake
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / cmake / modules / BuildSPDK.cmake
index 2e9b31b8d0d2e7c83adb4521d27006538411d1d5..05a6b237006769d68f20c8bf47c6b788133c9cc2 100644 (file)
@@ -9,17 +9,8 @@ macro(build_spdk)
     find_package(aio REQUIRED)
     find_package(uuid REQUIRED)
   endif()
-
-  find_program(MAKE_EXECUTABLE NAMES gmake make)
-  if(NOT MAKE_EXECUTABLE)
-    message(FATAL_ERROR "Can't find make")
-  endif()
-  if(CMAKE_MAKE_PROGRAM MATCHES "make")
-    # try to inherit command line arguments passed by parent "make" job
-    set(make_cmd "$(MAKE)")
-  else()
-    set(make_cmd "${MAKE_EXECUTABLE}")
-  endif()
+  include(FindMake)
+  find_make("MAKE_EXECUTABLE" "make_cmd")
 
   set(spdk_CFLAGS "-fPIC")
   include(CheckCCompilerFlag)
@@ -28,10 +19,21 @@ macro(build_spdk)
     set(spdk_CFLAGS "${spdk_CFLAGS} -Wno-address-of-packed-member")
   endif()
   include(ExternalProject)
+  if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64|AMD64")
+    # a safer option than relying on the build host's arch
+    set(target_arch core2)
+  else()
+    # default arch used by SPDK
+    set(target_arch native)
+  endif()
   ExternalProject_Add(spdk-ext
     DEPENDS dpdk-ext
     SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/spdk
-    CONFIGURE_COMMAND ./configure --with-dpdk=${DPDK_DIR} --without-isal --without-vhost
+    CONFIGURE_COMMAND ./configure
+      --with-dpdk=${DPDK_DIR}
+      --without-isal
+      --without-vhost
+      --target-arch=${target_arch}
     # unset $CFLAGS, otherwise it will interfere with how SPDK sets
     # its include directory.
     # unset $LDFLAGS, otherwise SPDK will fail to mock some functions.
@@ -40,7 +42,7 @@ macro(build_spdk)
     INSTALL_COMMAND "true")
   unset(make_cmd)
   ExternalProject_Get_Property(spdk-ext source_dir)
-  foreach(c nvme log lvol env_dpdk sock util)
+  foreach(c lvol env_dpdk sock nvmf bdev nvme conf thread trace notify accel event_accel blob vmd event_vmd event_bdev sock_posix event_sock event rpc jsonrpc json util log)
     add_library(spdk::${c} STATIC IMPORTED)
     add_dependencies(spdk::${c} spdk-ext)
     set_target_properties(spdk::${c} PROPERTIES