From: Willem Jan Withagen Date: Fri, 20 Sep 2019 14:02:23 +0000 (+0200) Subject: cmake: Allow cephfs and ceph-mds to be build when building on FreeBSD X-Git-Tag: v14.2.5~32^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F31011%2Fhead;p=ceph.git cmake: Allow cephfs and ceph-mds to be build when building on FreeBSD on FreeBSD keyutil absence prevents building KRBD and mount. But on FreeBSD icephfs, ceph-fuse and ceph-mds do work, so we need ceph-mds to be build. Signed-off-by: Willem Jan Withagen (cherry picked from commit f698f3c3eef4034799005b8816de5d468ef9fe18) Conflicts: CMakeLists.txt - nautilus does not have "if (HAVE_LIBTCMALLOC AND TCMALLOC_VERSION_STRING VERSION_LESS 2.6.2)" clause, and c028de2f938bc9b8c0193b9219fb64e1416037cf refactored HAVE_GENL out of master src/mount/CMakeLists.txt - CAPNG was introduced in master: omitted the changes --- diff --git a/CMakeLists.txt b/CMakeLists.txt index fb3eac9d09a..106dbd231a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -222,11 +222,14 @@ if(LINUX) find_package(genl REQUIRED) set(HAVE_GENL $GENL_FOUND) endif() + find_package(keyutils REQUIRED) + set(HAVE_KEYUTILS ${KEYUTILS_FOUND}) elseif(FREEBSD) set(HAVE_UDEV OFF) set(HAVE_LIBAIO OFF) set(HAVE_BLKID OFF) set(HAVE_GENL OFF) + set(HAVE_KEYUTILS OFF) else() set(HAVE_UDEV OFF) message(STATUS "Not using udev") @@ -323,6 +326,13 @@ option(WITH_KRBD "Kernel Remote block storage is here" ON) if(WITH_KRBD AND WITHOUT_RBD) message(FATAL_ERROR "Cannot have WITH_KRBD with WITH_RBD.") endif() +if(LINUX) + if(WITH_LIBCEPHFS OR WITH_KRBD) + # keyutils is only used when talking to the Linux Kernel key store + find_package(keyutils REQUIRED) + set(HAVE_KEYUTILS ${KEYUTILS_FOUND}) + endif() +endif() option(WITH_LEVELDB "LevelDB is here" ON) if(WITH_LEVELDB) @@ -389,10 +399,6 @@ else() set(EXE_LINKER_USE_PIE ${ENABLE_SHARED}) endif() -if(WITH_LIBCEPHFS OR WITH_KRBD) - find_package(keyutils REQUIRED) -endif() - find_package(CURL REQUIRED) set(CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBRARIES}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4895e84df63..4ac08f9d004 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -651,7 +651,9 @@ if(WITH_LIBCEPHFS) add_executable(ceph-syn ${ceph_syn_srcs}) target_link_libraries(ceph-syn client global-static ceph-common) install(TARGETS ceph-syn DESTINATION bin) - add_subdirectory(mount) + if(LINUX) + add_subdirectory(mount) + endif() endif(WITH_LIBCEPHFS) if(WITH_FUSE) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 8120454b81a..bd9276520dc 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -177,7 +177,7 @@ target_link_libraries(crc32 add_library(common_utf8 STATIC utf8.c) -if(WITH_LIBCEPHFS OR WITH_KRBD) +if(HAVE_KEYUTILS) set(parse_secret_srcs secret.c) add_library(parse_secret_objs OBJECT ${parse_secret_srcs})