From: wy7980 Date: Mon, 11 Nov 2019 13:01:52 +0000 (-0500) Subject: cmake: link ceph-fuse against librt X-Git-Tag: v15.1.0~824^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aabfe40183bd384426c4a6a45847b6c70f2d57be;p=ceph.git cmake: link ceph-fuse against librt ceph-fuse: fix error of building ceph-fuse fix linking error of without -lrt for ceph-fuse. error message: ``` [100%] Building CXX object src/CMakeFiles/ceph-fuse.dir/ceph_fuse.cc.o [100%] Building CXX object src/CMakeFiles/ceph-fuse.dir/client/fuse_ll.cc.o [100%] Linking CXX executable ../bin/ceph-fuse /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: CMakeFiles/ceph-fuse.dir/ceph_fuse.cc.o: undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5' //lib64/librt.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[3]: *** [bin/ceph-fuse] Error 1 make[2]: *** [src/CMakeFiles/ceph-fuse.dir/all] Error 2 make[1]: *** [src/CMakeFiles/ceph-fuse.dir/rule] Error 2 make: *** [ceph-fuse] Error 2 ``` Signed-off-by: Yong Wang --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8109e3af0f3..46742dc306c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -689,7 +689,7 @@ if(WITH_FUSE) client/fuse_ll.cc) add_executable(ceph-fuse ${ceph_fuse_srcs}) target_link_libraries(ceph-fuse ${FUSE_LIBRARIES} - ${GSSAPI_LIBRARIES} client ceph-common global-static) + ${GSSAPI_LIBRARIES} client ceph-common global-static ${EXTRALIBS}) set_target_properties(ceph-fuse PROPERTIES COMPILE_FLAGS "-I${FUSE_INCLUDE_DIRS}" POSITION_INDEPENDENT_CODE ${EXE_LINKER_USE_PIE})