Skip to content

Commit 19b406f

Browse files
committed
blk/CMakeLists.txt: generate interface library if libblk is disabled
If all the libraries which `libblk` wraps (i.e. Bluestore, AIO, SPDK, ZBD) are disabled, then the build aborts with a linker failure: ``` c++ [...] -o bin/ceph-mon [...] -lblk [...] mold: fatal: library not found: blk collect2: error: ld returned 1 exit status ``` This is because `blk` is used (via `os`) but if the `add_library()` directive is skipped, `cmake` attempts to look up a library with that name. Signed-off-by: Max Kellermann <[email protected]>
1 parent 24378a0 commit 19b406f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/blk/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ endif()
2323
if(libblk_srcs)
2424
add_library(blk STATIC ${libblk_srcs})
2525
target_include_directories(blk PRIVATE "./")
26+
else()
27+
add_library(blk INTERFACE)
2628
endif()
2729

2830
if(HAVE_LIBAIO)

0 commit comments

Comments
 (0)