Skip to content

Commit

Permalink
cmake: link ceph-fuse against librt
Browse files Browse the repository at this point in the history
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: wangyong <wy7980@sina.com>
  • Loading branch information
wy7980 committed Nov 11, 2019
1 parent ec70182 commit fede9ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Expand Up @@ -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})
Expand Down

0 comments on commit fede9ab

Please sign in to comment.