]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: do not build libblk if libblk_srcs is empty
authorKefu Chai <kchai@redhat.com>
Mon, 26 Apr 2021 15:17:02 +0000 (23:17 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 2 May 2021 00:15:15 +0000 (08:15 +0800)
if we don't or just not able to buld libblk, let's skip it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/blk/CMakeLists.txt

index 849f3eef9de2e513effe7eebb2d32e404e0f0c5a..aaebc3c99f0f9713a0e4e49da1c97c3fb71c1785 100644 (file)
@@ -25,8 +25,10 @@ if(WITH_ZBD)
     zoned/HMSMRDevice.cc)
 endif()
 
-add_library(blk STATIC ${libblk_srcs})
-target_include_directories(blk PRIVATE "./")
+if(libblk_srcs)
+  add_library(blk STATIC ${libblk_srcs})
+  target_include_directories(blk PRIVATE "./")
+endif()
 
 if(HAVE_LIBAIO)
   target_link_libraries(blk PUBLIC ${AIO_LIBRARIES})