Merge PR #30494 into master

* refs/pull/30494/head:
	cmake: Allow cephfs and ceph-mds to be build when building on FreeBSD

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Patrick Donnelly 2019-10-10 16:37:27 -07:00
commit 729eda7cce
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB
4 changed files with 17 additions and 8 deletions

View File

@ -132,10 +132,13 @@ if(LINUX)
set(HAVE_UDEV ${UDEV_FOUND})
find_package(blkid REQUIRED)
set(HAVE_BLKID ${BLKID_FOUND})
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_KEYUTILS OFF)
else()
set(HAVE_UDEV OFF)
set(HAVE_BLKID OFF)
@ -231,6 +234,13 @@ option(WITH_KRBD "Enable Linux krbd support of 'rbd' utility" ON)
if(WITH_KRBD AND NOT WITH_RBD)
message(FATAL_ERROR "Cannot have WITH_KRBD without 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)
@ -301,10 +311,6 @@ if (HAVE_LIBTCMALLOC AND TCMALLOC_VERSION_STRING VERSION_LESS 2.6.2)
set(LIBTCMALLOC_MISSING_ALIGNED_ALLOC ON)
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})

View File

@ -646,8 +646,6 @@ add_subdirectory(bash_completion)
add_subdirectory(client)
if(WITH_LIBCEPHFS)
find_package(PkgConfig QUIET REQUIRED)
pkg_check_modules(CAPNG REQUIRED libcap-ng)
set(libcephfs_srcs libcephfs.cc)
add_library(cephfs ${CEPH_SHARED} ${libcephfs_srcs})
target_link_libraries(cephfs PRIVATE client ceph-common
@ -674,7 +672,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)

View File

@ -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})

View File

@ -1,3 +1,6 @@
find_package(PkgConfig QUIET REQUIRED)
pkg_check_modules(CAPNG REQUIRED libcap-ng)
set(mount_ceph_srcs
mount.ceph.c conf.cc)
add_executable(mount.ceph ${mount_ceph_srcs}