From 98b70c149d505189e4b000e65b7679b0cca555eb Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 17 Mar 2025 14:26:18 +0800 Subject: [PATCH] cmake: make libcap REQUIRED this header is required when building the extended block device plugins on linux, without it the build fails like: ``` /home/kefu/dev/ceph/src/extblkdev/ExtBlkDevInterface.h:38:10: fatal error: 'sys/capability.h' file not found 38 | #include | ^~~~~~~~~~~~~~~~~~ ``` so, let's mark this package REQUIRED, so that we can fail early when generating the building system. Signed-off-by: Kefu Chai --- src/extblkdev/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extblkdev/CMakeLists.txt b/src/extblkdev/CMakeLists.txt index 27e7c23e4942f..648e5de9e43c7 100644 --- a/src/extblkdev/CMakeLists.txt +++ b/src/extblkdev/CMakeLists.txt @@ -6,9 +6,9 @@ add_subdirectory(vdo) add_library(extblkdev STATIC ExtBlkDevPlugin.cc) -if(NOT WIN32) -find_package(cap) -target_link_libraries(extblkdev cap) +if(LINUX) + find_package(cap REQUIRED) + target_link_libraries(extblkdev cap) endif() add_custom_target(extblkdev_plugins DEPENDS -- 2.39.5